Description
Wave 3 found no test that drives the lifespan-created startup task through _on_startup_task_done after collect_initial raises StartupConfigurationError. A callback regression could leave health green while startup collection has failed.
Acceptance Criteria
- #1 A lifespan-driven test lets the background startup task settle after StartupConfigurationError
- #2 The test proves the startup configuration error is retained and health returns 503
Definition of Done
- #1 just check (ruff format –check, ruff check, mypy, generated-doc drift, offline API conformance, and the marker-filtered pytest run with the 80% coverage floor — this is exactly what the CI
testjob runs) - #2 just gen, when metrics, config, endpoints, collectors, the settings schema or the chart config changed —
just checkincludes the drift gate and CI fails the build on it - #3 Grafana queries in grafana/dashboards/*.json and grafana/alerts/ updated, if a metric or label name changed
Implementation Plan
Exercise the real lifespan-created startup task with a delayed StartupConfigurationError and assert the callback records it for the health endpoint.
Implementation Notes
A real lifespan test now lets the background startup task fail after yield, proves the callback retains StartupConfigurationError, proves the dead-man switch trips, and verifies GET /health returns 503. Integrated gate: 2827 passed.
Final Summary
Added the missing lifespan/background-task health contract; post-yield startup configuration failure is proven to return HTTP 503.