test: Improve io test perfomance

Local test improves performance by 15%.
This commit is contained in:
Wolfgang Walther
2022-01-04 09:36:22 +01:00
committed by Wolfgang Walther
parent 1e9031573c
commit 01e65f5221
9 changed files with 4 additions and 15 deletions
@@ -1,5 +1,2 @@
db-pool = 1
db-pool-timeout = 1
app.settings.external_api_secret = "0123456789abcdef"
db-config = false
@@ -1,5 +1,3 @@
db-pool = 1
# Read secret from a file: /dev/stdin (alias for standard input)
jwt-secret = "@/dev/stdin"
jwt-secret-is-base64 = true
@@ -1,4 +1,3 @@
db-uri = "@/dev/stdin"
db-pool = 1
jwt-secret = "reallyreallyreallyreallyverysafe"
db-config = false
@@ -1,4 +1,3 @@
db-pool = 1
jwt-role-claim-key = "$(ROLE_CLAIM_KEY)"
jwt-secret = "reallyreallyreallyreallyverysafe"
db-config = false
@@ -1,5 +1,3 @@
db-pool = 1
# Read secret from a file: /dev/stdin (alias for standard input)
jwt-secret = "@/dev/stdin"
jwt-secret-is-base64 = false
@@ -1,5 +1,3 @@
db-pool = 1
jwt-secret = "$(JWT_SECRET_FILE)"
jwt-secret-is-base64 = false
db-config = false
@@ -1,5 +1,4 @@
db-schemas = "public"
db-pool = 1
app.settings.name_var = "John"
jwt-secret = "invalidinvalidinvalidinvalidinvalid"
-1
View File
@@ -1,3 +1,2 @@
db-pool = 1
jwt-secret = "reallyreallyreallyreallyverysafe"
db-config = false
+4 -2
View File
@@ -139,6 +139,8 @@ def dumpconfig(configpath=None, env=None, stdin=None):
def run(configpath=None, stdin=None, env=None, port=None, adminport=None):
"Run PostgREST and yield an endpoint that is ready for connections."
env = env or {}
env["PGRST_DB_POOL"] = "1"
env["PGRST_DB_POOL_TIMEOUT"] = "1"
with tempfile.TemporaryDirectory() as tmpdir:
if port:
@@ -465,7 +467,7 @@ def test_iat_claim(defaultenv):
response = postgrest.session.get("/authors_only", headers=headers)
assert response.status_code == 200
time.sleep(0.5)
time.sleep(0.1)
def test_app_settings(defaultenv):
@@ -621,7 +623,7 @@ def test_db_schema_notify_reload(defaultenv):
"/rpc/change_db_schema_and_full_reload", data={"schemas": "v1"}
)
time.sleep(0.5)
time.sleep(0.1)
response = postgrest.session.get("/rpc/get_guc_value?name=search_path")
assert response.text == '"v1, public"'