feat(widgets): a troubled container on the Docker widget says since when (#5810)
CI / lint (push) Successful in 3s
CI / integration (push) Successful in 1m23s
CI / unit (push) Successful in 1m33s
CI / publish (push) Successful in 1m7s

Its problems and since come from the same container_problems and
problem_since the Docker page uses, read from the day's deaths and
health changes; troubled containers sort worst problem first, then name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 10:09:25 -04:00
co-authored by Claude Opus 5.5
parent c113cadbdd
commit 5c7a4cf9a0
3 changed files with 30 additions and 2 deletions
+10
View File
@@ -299,6 +299,16 @@ async def test_the_services_widget_lists_what_is_wrong_then_packs_the_healthy(ap
assert not hex_colours(page), hex_colours(page)
async def test_a_troubled_container_says_since_when_on_the_widget(app):
"""#5810: a container in trouble carries its since, as the Docker page does."""
sick = _c("backup_cron", host_id="h1", status="running", health="unhealthy")
page = await _services_widget(
app, bad_containers=[sick],
bad_since={("h1", "backup_cron"): datetime.now(timezone.utc) - timedelta(minutes=40)})
page = " ".join(page.split())
assert "unhealthy since <time" in page and "40m ago" in page and "· VDNT-Docker02" in page
async def test_the_services_widget_says_when_all_is_well(app):
page = await _services_widget(app, services_total=2, services_healthy=2, running_count=1,
healthy=[{"kind": "service", "s": _widget_svc("a")}])