-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: requests wait for schema cache load #3328
Conversation
CI says:
(https://github.com/PostgREST/postgrest/actions/runs/8289451731/job/22685899055?pr=3328) Why is the new Nix command not working here? Am I getting the nix commands from cache somehow? It does work locally: $ postgrest-with-postgresql-15 postgrest-test-big-schema
test/io/test_big_schema.py::test_requests_wait_for_schema_cache_to_be_loaded
PASSED [ 50%]
test/io/test_big_schema.py::test_openapi_in_big_schema SKIPPED (unconditional skip) [100%]
============================================================================== 1 passed, 1 skipped in 43.73s ==============================================================================
|
7e96867
to
1eb8011
Compare
@wolfgangwalther @develop7 Could you guys advice on how to refresh the Nix cache 🙏? Not sure what I'm doing wrong Edit: Oh, nevermind. I needed to add this line https://github.com/PostgREST/postgrest/pull/3328/files#diff-245392b692a50c38ecab4381b118862db514035c10983f3bd4f4b7f1f4be4692R84 Follow up idea: How about renaming |
1eb8011
to
fe10f50
Compare
* nix: add postgrest-test-big-schema command
ef538f4
to
7789e3a
Compare
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" | ||
|
||
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_for_readiness=False) as postgrest: | ||
time.sleep(1.5) # manually wait for schema cache to start loading | ||
|
||
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 > 10000.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the gist of the PR
I'll put that on my TODO list. It might be possible to change it to use |
Proves #3327