test: adjust test_positive_pool_metric

Adjusted so it waits for liveness instead of requiring sleeping
This commit is contained in:
steve-chavez
2026-05-18 10:46:02 -05:00
parent 1eba9855c1
commit 6220ab3f31
+2 -4
View File
@@ -2169,12 +2169,10 @@ def test_vary_default_header_set(defaultenv):
def test_positive_pool_metric(defaultenv):
"When a network failure is caused on the pg connection, pgrst_db_pool_available stays positive"
with run_pgproxy(defaultenv, proxy_timeout="10ms") as pgproxyhost:
with run_pgproxy(defaultenv, proxy_timeout="1ms") as pgproxyhost:
env = {**defaultenv, "PGHOST": pgproxyhost}
with run(env=env, wait_for=None) as postgrest:
time.sleep(3)
with run(env=env, wait_for=Admin.live) as postgrest:
response = postgrest.admin.get("/metrics", timeout=1)
assert response.status_code == 200