diff --git a/roles/test_alerts/tasks/test_create_an_alert.yml b/roles/test_alerts/tasks/test_create_an_alert.yml index 1f5e4ced..03c8426f 100644 --- a/roles/test_alerts/tasks/test_create_an_alert.yml +++ b/roles/test_alerts/tasks/test_create_an_alert.yml @@ -42,12 +42,12 @@ until: '"FVT_TESTING Collectd metrics receive rate is zero" in cmd_output.stdout' always: - - name: "Delete the alert" + - name: "Delete the PrometheusRule" ansible.builtin.command: cmd: | oc delete prometheusrule.{{ observability_api }} fvt-testing-prometheus-alarm-rules - - name: Wait up to two minutes until the alert is deleted + - name: Wait up to two minutes until the rule is deleted ansible.builtin.command: cmd: | curl -k {{ prom_auth_string }} https://{{ prom_url }}/api/v1/rules diff --git a/roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml b/roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml index cbe2e7f8..4c1b6f5c 100644 --- a/roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml +++ b/roles/test_alerts/tasks/test_creating_a_standard_alert_route_in_alert_manager.yml @@ -72,7 +72,6 @@ for i in {1..15}; do oc delete po -l application=default-interconnect; sleep 1; done changed_when: false - # The wget executable is not available in prometheus container - name: "RHELOSP-148698 Verify that the alert is active in Alertmanager" ansible.builtin.shell: cmd: >- @@ -103,6 +102,14 @@ ansible.builtin.command: | oc delete prometheusrule.{{ observability_api }} fvt-testing-prometheus-alarm-rules + - name: "Wait up to two minutes until the rule is deleted" + ansible.builtin.command: + cmd: | + curl -k {{ prom_auth_string }} https://{{ prom_url }}/api/v1/rules + retries: 12 + delay: 10 + until: 'not "FVT_TESTING Collectd metrics receive rate is zero" in cmd_output.stdout' + - name: "Wait up to 2 minutes to make sure all default-interconnect pods are back" ansible.builtin.command: oc get pods -l application=default-interconnect