fix: incorrect /ready response on slow schema load
This commit is contained in:
committed by
Steve Chavez
parent
4b289b1c97
commit
11d8da046c
@@ -7,6 +7,26 @@ from util import *
|
||||
from postgrest import *
|
||||
|
||||
|
||||
def test_first_request_succeeds(defaultenv):
|
||||
"the first request suceeds fast since the admin server readiness was checked before"
|
||||
|
||||
env = {
|
||||
**defaultenv,
|
||||
"PGRST_DB_SCHEMAS": "apflora",
|
||||
"PGRST_DB_POOL": "2",
|
||||
"PGRST_DB_ANON_ROLE": "postgrest_test_anonymous",
|
||||
"PGRST_SERVER_TIMING_ENABLED": "true",
|
||||
}
|
||||
|
||||
with run(env=env, wait_max_seconds=20) as postgrest:
|
||||
response = postgrest.session.get("/tpopmassn?select=*,tpop(*)")
|
||||
assert response.status_code == 200
|
||||
|
||||
server_timings = parse_server_timings_header(response.headers["Server-Timing"])
|
||||
plan_dur = server_timings["plan"]
|
||||
assert plan_dur < 2.0
|
||||
|
||||
|
||||
def test_requests_wait_for_schema_cache_to_be_loaded(defaultenv):
|
||||
"requests that use the schema cache (e.g. resource embedding) wait for schema cache to be loaded"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user