Skip to content

Commit 8c89c35

Browse files
committed
Allow for Prometheus alerts that can occur in an AIO when ideally testing for no alerts.
1 parent 006976e commit 8c89c35

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

stackhpc_cloud_tests/monitoring/test_prometheus.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,21 @@ def test_prometheus_alerts_inactive(prom):
5555
response = response.json()
5656
assert "status" in response
5757
assert response["status"] == "success"
58-
alerts = response["data"]["alerts"]
59-
assert not alerts
58+
assert "data" in response
59+
alerts = response["data"]["alerts"] or []
60+
# (MaxN) Allow for, and filter out, alerts we'd expect to see in an AIO environment.
61+
# TODO - find a way of configuring this for SCT runs in other environments.
62+
alerts_to_ignore = [
63+
# We know our volumes are small.
64+
"StorageFillingUp",
65+
# This is probably due to storage space..
66+
"ElasticsearchClusterYellow",
67+
# ..or because we're running in a single instance and it wants to be clustered across multiple nodes.
68+
"ElasticsearchUnassignedShards",
69+
# It's a small AIO!
70+
"LowMemory",
71+
# It's only one node and expects three, see https://github.com/stackhpc/stackhpc-kayobe-config/pull/1579
72+
"RabbitMQNodeDown"
73+
]
74+
alerts = [ alert for alert in alerts if alert["labels"]["alertname"] not in alerts_to_ignore ]
75+
assert len(alerts) == 0

0 commit comments

Comments
 (0)