fix(mcp): a failing router in get_overview says since when, as the page does (#5860)
router_findings never passed `since`, so every failing router read as brand new and sorted last among the criticals. The overview now reads the failing routers' last day of history and dates each one with problem_since, as the dashboard widget does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,14 @@ def test_only_a_failing_router_is_an_overview_finding():
|
||||
[f] = t.router_findings(routers)
|
||||
assert f["severity"] == "critical" and f["subject"] == "app@swarm"
|
||||
assert "Mostly 502" in f["summary"] and f["next"] == 'get_router(router="app@swarm")'
|
||||
assert f["since"] is None
|
||||
|
||||
|
||||
def test_a_failing_router_says_since_when():
|
||||
began = NOW - timedelta(hours=2)
|
||||
[f] = t.router_findings([{"name": "app@swarm", "state": "crit", "why": "12.0% of responses are 5xx",
|
||||
"since": began}])
|
||||
assert f["since"] == "2026-10-15T10:00:00Z" and f["age_s"] > 0
|
||||
|
||||
|
||||
def test_a_router_is_found_with_or_without_its_provider():
|
||||
|
||||
Reference in New Issue
Block a user