Skip to content

Commit e4f62cf

Browse files
authored
[test_alerts] Replace pause with retry/until (#198)
* Replace pause with a continuous check * Extend the wait time, to account for latency
1 parent 4f38187 commit e4f62cf

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33

44
# Pre-check: is the value of global.timeout = 5m in the alertmanager secret
55

6+
- name: "Get the number of default-interconnect pods"
7+
ansible.builtin.command:
8+
cmd: |
9+
oc get pods -l application=default-interconnect
10+
register: expected_pods
11+
changed_when: false
12+
613
- name: "Do the test procedure"
714
block:
815
# TODO: put the patch into a file. and use --patch-file instead of -p OR slurp the file from files/
@@ -101,10 +108,16 @@
101108
until: 'not "FVT_TESTING Collectd metrics receive rate is zero" in cmd_output.stdout'
102109
changed_when: false
103110

104-
- name: "Wait 2 minutes to make sure all SG pods are back to normal"
105-
ansible.builtin.pause:
106-
minutes: 2
107-
111+
- name: "Wait up to 5 minutes to make sure all default-interconnect pods are back"
112+
ansible.builtin.command:
113+
cmd: |
114+
oc get pods -l application=default-interconnect
115+
retries: 30
116+
delay: 10
117+
register: output
118+
until: output.stdout_lines | length == expected_pods.stdout_lines | length
119+
changed_when: false
120+
108121

109122
- name: "RHELOSP-176039 Remove alertmanagerConfigManifest from the ServiceTelemetry object"
110123
ansible.builtin.shell:

0 commit comments

Comments
 (0)