test(alerts): fix the silent-finding time and keep cpu_pct first in the host_agent catalog (#5062)
CI / lint (push) Successful in 3s
CI / integration (push) Successful in 55s
CI / unit (push) Successful in 1m13s
CI / publish (push) Successful in 1m25s

CI 8325: NOW - 10 min is 11:50, not 09:50; and rule_fields' refusal lists
the catalog in order, so seconds_since_seen goes last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 13:23:18 -04:00
co-authored by Claude Opus 5.5
parent c368e93e2c
commit b009a8dd30
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -161,10 +161,10 @@ def test_alert_findings_say_when_a_metric_went_silent():
no_data_since=silent), rule),
])
assert (quiet["kind"], quiet["severity"]) == ("alert_no_data", "warning")
assert quiet["since"] == "2026-10-06T09:50:00Z" and "stopped reporting" in quiet["summary"]
assert quiet["since"] == "2026-10-06T11:50:00Z" and "stopped reporting" in quiet["summary"]
# A firing alert that goes silent stays a firing finding, marked.
assert (firing["kind"], firing["severity"]) == ("alert_firing", "critical")
assert "no data since 2026-10-06T09:50:00Z" in firing["summary"]
assert "no data since 2026-10-06T11:50:00Z" in firing["summary"]
THRESHOLDS = {"cpu": {"warn": 80, "crit": 90}, "mem": {"warn": 80, "crit": 90},