Skip to content

Commit f970185

Browse files
committed
[os_must_gather] Increase must gather timeout; print error on timeout
It seems that 'oc adm must-gather' command in some CI jobs does not finish on time. This commit increase the timeout from default 12 minutes (cifmw_os_must_gather_timeout - 10 minutes + 120s) to 25 minutes. Also print message when timeout has killed the command. Signed-off-by: Daniel Pawlik <[email protected]>
1 parent 3029813 commit f970185

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

roles/os_must_gather/tasks/main.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
- _kubeconfig_stat.stat.exists
5757
block:
5858
- name: Run openstack-must-gather command
59+
vars:
60+
shell_cmd_timeout: "{{ (cifmw_os_must_gather_timeout | community.general.to_seconds) + 900 }}"
5961
environment:
6062
KUBECONFIG: "{{ cifmw_openshift_kubeconfig | default(cifmw_os_must_gather_kubeconfig) }}"
6163
PATH: "{{ cifmw_path }}"
@@ -65,7 +67,7 @@
6567
cifmw.general.ci_script:
6668
output_dir: "{{ cifmw_os_must_gather_output_dir }}/artifacts"
6769
script: >-
68-
timeout {{ (cifmw_os_must_gather_timeout | community.general.to_seconds) + 120 }}
70+
timeout {{ shell_cmd_timeout }}
6971
oc adm must-gather --image {{ cifmw_os_must_gather_image }}
7072
--timeout {{ cifmw_os_must_gather_timeout }}
7173
--host-network={{ cifmw_os_must_gather_host_network }}
@@ -75,7 +77,13 @@
7577
SOS_EDPM=$SOS_EDPM
7678
SOS_DECOMPRESS=$SOS_DECOMPRESS
7779
gather
78-
2>&1
80+
2>&1 || {
81+
rc=$?
82+
if [ $rc -eq 124 ]; then
83+
echo "The must gather command did not finish on time!"
84+
echo "{{ shell_cmd_timeout }} seconds was not enough to finish the task."
85+
fi
86+
}
7987
8088
- name: Find existing os-must-gather directories
8189
ansible.builtin.find:

0 commit comments

Comments
 (0)