fix(docker): a crash-looping service belongs in Needs attention (#5209)
CI / lint (push) Successful in 4s
CI / unit (push) Successful in 1m34s
CI / integration (push) Successful in 1m10s
CI / publish (push) Successful in 3m1s

failing_services filtered on `(service_trouble(s) or 9) <= 2`; a crash loop
ranks 0, which is falsy, so the worst kind of trouble was left out. Test the
rank against None. The page test's task error also gains the age_s the
_swarm_failures include reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 23:46:02 -04:00
co-authored by Claude Opus 5.5
parent 61b22056d5
commit a39633626b
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ async def test_a_failing_service_leads_and_the_failures_are_listed(app):
"crash_looping": True, "failures_1h": 7, "failures_24h": 9, "tasks_known": True,
"trouble_since": now - timedelta(minutes=20), "replicas": [], "previous_tasks": 7,
"last_error": {"state": "failed", "error": "task: non-zero exit (1)", "exit_code": 1,
"node": "nas", "at": None}}
"node": "nas", "at": None, "age_s": 120}}
failures = [{"kind": "service", "name": "codex_db", "host_id": None, "host": "nas", "count": 9,
"at": now - timedelta(minutes=2), "detail": "task: non-zero exit (1)"},
{"kind": "container", "name": "backup", "host_id": "h1", "host": "nas", "count": 1,