From a037d8e0b0b5d4a5f10e977c9160f5c4c35359a2 Mon Sep 17 00:00:00 2001 From: rpdevmp Date: Thu, 5 Dec 2024 14:07:26 -0800 Subject: [PATCH] Inverting logic for alerts priority --- tests/rptest/redpanda_cloud_tests/observe_test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/rptest/redpanda_cloud_tests/observe_test.py b/tests/rptest/redpanda_cloud_tests/observe_test.py index dc6b00d83e673..4d92235121596 100644 --- a/tests/rptest/redpanda_cloud_tests/observe_test.py +++ b/tests/rptest/redpanda_cloud_tests/observe_test.py @@ -67,15 +67,16 @@ def test_cloud_observe(self): for alert in alerts: alert_message = f"alert firing for cluster: {alert.labels.grafana_folder} / {alert.labels.alertname}" - if "high priority" in alert_message.lower(): - self.logger.error(f"High priority - {alert_message}") - high_priority_alerts.append(alert_message) + # Treat all alerts not explicitly marked as "low priority" as high priority + if "low priority" in alert_message.lower(): + self.logger.warn(f"Low priority alert - {alert_message}") else: - self.logger.warning(f"Low priority - {alert_message}") + self.logger.error(f"High priority alert - {alert_message}") + high_priority_alerts.append(alert_message) # Fail the test if high-priority alerts are present assert not high_priority_alerts, ( - f"Test failed due to high-priority alerts:\n{high_priority_alerts}" + f"Test failed due to potential high-priority alerts:\n{high_priority_alerts}" ) self.logger.info("Cloud observe test completed successfully.")