@@ -1447,31 +1447,6 @@ def test_schema_cache_query_sleep_logs(defaultenv):
14471447 assert 1000 < observed_ms < 2000
14481448
14491449
1450- def test_schema_cache_load_sleep_logs (defaultenv ):
1451- """Schema cache load sleep should be reflected in the logged load duration."""
1452-
1453- env = {
1454- ** defaultenv ,
1455- "PGRST_INTERNAL_SCHEMA_CACHE_LOAD_SLEEP" : "1000" ,
1456- }
1457- log_pattern = re .compile (r"Schema cache loaded in ([\d.]+) milliseconds" )
1458-
1459- with run (env = env , wait_max_seconds = 3 , no_startup_stdout = False ) as postgrest :
1460- observed_ms = None
1461- collected = []
1462-
1463- lines = postgrest .read_stdout (nlines = 10 )
1464- collected .extend (lines )
1465- for line in lines :
1466- match = log_pattern .search (line )
1467- if match :
1468- observed_ms = float (match .group (1 ))
1469- break
1470-
1471- assert observed_ms is not None
1472- assert 1000 < observed_ms < 2000
1473-
1474-
14751450@pytest .mark .parametrize ("timezone_enabled" , ["true" , "false" ])
14761451@pytest .mark .parametrize ("level" , ["crit" , "error" , "warn" , "info" , "debug" ])
14771452def test_schema_cache_query_timings_log (level , timezone_enabled , defaultenv ):
@@ -2109,54 +2084,6 @@ def test_db_pre_config_with_pg_reserved_words(defaultenv):
21092084 )
21102085
21112086
2112- def test_requests_with_resource_embedding_wait_for_schema_cache_reload (defaultenv ):
2113- "requests that use the schema cache with resource embedding wait long for the schema cache to reload"
2114-
2115- env = {
2116- ** defaultenv ,
2117- "PGRST_DB_POOL" : "2" ,
2118- "PGRST_INTERNAL_SCHEMA_CACHE_RELATIONSHIP_LOAD_SLEEP" : "5100" ,
2119- }
2120-
2121- with run (env = env , wait_max_seconds = 30 ) as postgrest :
2122- # reload the schema cache
2123- response = postgrest .session .get ("/rpc/notify_pgrst" )
2124- assert response .status_code == 204
2125-
2126- postgrest .wait_until_scache_starts_loading ()
2127-
2128- response = postgrest .session .get ("/directors?select=id,name,films(title)" )
2129- assert response .status_code == 200
2130-
2131- assert response .elapsed .total_seconds () > 5
2132-
2133-
2134- def test_requests_without_resource_embedding_wait_for_schema_cache_reload (defaultenv ):
2135- "requests that use the schema cache without resource embedding wait less for the schema cache to reload"
2136-
2137- env = {
2138- ** defaultenv ,
2139- "PGRST_DB_POOL" : "2" ,
2140- "PGRST_INTERNAL_SCHEMA_CACHE_LOAD_SLEEP" : "1100" ,
2141- "PGRST_INTERNAL_SCHEMA_CACHE_RELATIONSHIP_LOAD_SLEEP" : "5000" ,
2142- }
2143-
2144- with run (env = env , wait_max_seconds = 30 ) as postgrest :
2145- # reload the schema cache
2146- response = postgrest .session .get ("/rpc/notify_pgrst" )
2147- assert response .status_code == 204
2148-
2149- postgrest .wait_until_scache_starts_loading ()
2150-
2151- response = postgrest .session .get ("/films" )
2152- assert response .status_code == 200
2153-
2154- assert (
2155- response .elapsed .total_seconds () > 1
2156- and response .elapsed .total_seconds () < 5
2157- )
2158-
2159-
21602087def test_server_timing_transaction_duration (defaultenv , metapostgrest ):
21612088 "server-timing transaction duration should be accurate"
21622089
0 commit comments