fix: enforce durable migration ownership and readiness
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / pytest-smoke (push) Failing after 2s

This commit is contained in:
tegwick 2026-08-21 17:54:21 +02:00
parent 14befd0b50
commit 826874a47e
5 changed files with 52 additions and 0 deletions

View file

@ -89,6 +89,22 @@ def test_postgresql_readiness_fails_when_database_is_unavailable() -> None:
asyncio.run(store.aclose())
def test_postgresql_readiness_fails_when_runtime_tables_are_unavailable(tmp_path) -> None:
database_url = f"sqlite+aiosqlite:///{tmp_path / 'empty.db'}"
store = PostgresPortStore.from_url(database_url)
settings = RuntimeSettings(
environment="production",
backend="postgresql",
allow_ephemeral=False,
database_url=database_url,
)
response = TestClient(create_app(settings=settings, port_store=store)).get("/readyz")
assert response.status_code == 503
assert response.json()["checks"]["database"] == "unavailable"
asyncio.run(store.aclose())
def _event(event_type: str) -> dict:
return {
"schema_version": "0.1.0",