Forward-port lab3 SQLAlchemy and Alembic foundation

Carry source f591fa64e525679a31c9db7f942d36c789e1a12f forward from 72a1e57. Preserve lab4 attachment transactions, reconciliation locks, quarantine, and existing schema data through verified legacy adoption. Keep report and evidence work in progress untouched.
This commit is contained in:
Artyom
2026-11-06 01:47:30 +03:00
parent dd4021b678
commit 8e4532f6f5
54 changed files with 3459 additions and 617 deletions
+7
View File
@@ -211,6 +211,13 @@ async def test_postgres_stopped_gives_bounded_503_and_recovers(http: AsyncClient
me = await http.get("/api/v1/users/me", headers=bearer(token))
print(f"postgres запущен: готовность через {recovered:.1f} с, прежний токен {me.status_code}")
assert me.json() == user
instances = set()
for _ in range(40):
response = await http.post("/api/v1/users", json=new_user("recovered"))
assert response.status_code == 201
instances.add(response.headers["X-Instance-Id"])
print(f"postgres запущен: 40 регистраций 201 через {len(instances)} реплики без рестарта API")
assert len(instances) >= 2
assert started_at("api") == api_started