Revert "fix: slow responses on schema cache reload"
This reverts commit 727ef465c1.
Also documents requests waiting for the schema cache.
This commit is contained in:
committed by
Steve Chavez
parent
d7c64a93f8
commit
3d55f77bae
@@ -7,28 +7,8 @@ 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=30) 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_do_not_wait_for_schema_cache_reload(defaultenv):
|
||||
"requests that use the schema cache (e.g. resource embedding) do not wait for the schema cache to reload"
|
||||
def test_requests__wait_for_schema_cache_reload(defaultenv):
|
||||
"requests that use the schema cache (e.g. resource embedding) wait for the schema cache to reload"
|
||||
|
||||
env = {
|
||||
**defaultenv,
|
||||
@@ -48,10 +28,9 @@ def test_requests_do_not_wait_for_schema_cache_reload(defaultenv):
|
||||
response = postgrest.session.get("/tpopmassn?select=*,tpop(*)")
|
||||
assert response.status_code == 200
|
||||
|
||||
# response should be fast
|
||||
server_timings = parse_server_timings_header(response.headers["Server-Timing"])
|
||||
plan_dur = server_timings["plan"]
|
||||
assert plan_dur < 2.0
|
||||
assert plan_dur > 10000.0
|
||||
|
||||
|
||||
# TODO: This test fails now because of https://github.com/PostgREST/postgrest/pull/2122
|
||||
|
||||
Reference in New Issue
Block a user