test(alerts): fix the silent-finding time and keep cpu_pct first in the host_agent catalog (#5062)
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:
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user