feat(widgets): a troubled container on the Docker widget says since when (#5810)
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:
@@ -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")}])
|
||||
|
||||
Reference in New Issue
Block a user