Recover stale PostgreSQL connections before starting requests
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user