test: Separated query and loading internal sleep configs
To make schema cache loading wait tests robust it is necessary to provide three separate internal config variables: * "internal-schema-cache-query-sleep" - introduces delay in schema queries execution * "internal-schema-cache-load-sleep" - introduces delay between schema queries execution and processing their results * "internal-schema-cache-relationship-load-sleep" - introduces delay in processing relationship query results Thanks to these changes it is now possible to test various schema loading scenarios with the right granularity robustly (eg. make sure requests wait for schema loading but not for relationship loading).
This commit is contained in:
committed by
Steve Chavez
parent
07681d1b5b
commit
c08b87749b
+1
-1
@@ -61,7 +61,7 @@ def slow_schema_cache_env(defaultenv):
|
||||
"Slow schema cache load environment PostgREST."
|
||||
return {
|
||||
**defaultenv,
|
||||
"PGRST_INTERNAL_SCHEMA_CACHE_SLEEP": "1000", # this does a pg_sleep internally, it will cause the schema cache query to be slow
|
||||
"PGRST_INTERNAL_SCHEMA_CACHE_QUERY_SLEEP": "1000", # this does a pg_sleep internally, it will cause the schema cache query to be slow
|
||||
# the slow schema cache query will keep using one pool connection until it finishes
|
||||
# to prevent requests waiting for PGRST_DB_POOL_ACQUISITION_TIMEOUT we'll increase the pool size (must be >= 2)
|
||||
"PGRST_DB_POOL": "2",
|
||||
|
||||
Reference in New Issue
Block a user