test: isolate pg_terminate_backend to appname
The pg_terminate_backend done in the io test: `test_fail_with_automatic_recovery_disabled_and_terminated_using_query` Can affect other connections.
This commit is contained in:
committed by
Steve Chavez
parent
d5a4c5609e
commit
bfa4e1bedb
+4
-1
@@ -1214,11 +1214,14 @@ def test_fail_with_automatic_recovery_disabled_and_terminated_using_query(defaul
|
||||
env = {
|
||||
**defaultenv,
|
||||
"PGRST_DB_POOL_AUTOMATIC_RECOVERY": "false",
|
||||
"PGAPPNAME": "target",
|
||||
}
|
||||
|
||||
app_name = "'{}'".format(env["PGAPPNAME"])
|
||||
|
||||
with run(env=env) as postgrest:
|
||||
os.system(
|
||||
f'psql -d {defaultenv["PGDATABASE"]} -U {defaultenv["PGUSER"]} -h {defaultenv["PGHOST"]} --set ON_ERROR_STOP=1 -a -c "SELECT terminate_pgrst()"'
|
||||
f'psql -d {env["PGDATABASE"]} -U {env["PGUSER"]} -h {env["PGHOST"]} --set ON_ERROR_STOP=1 -a -c "SELECT terminate_pgrst({app_name})"'
|
||||
)
|
||||
|
||||
exitCode = wait_until_exit(postgrest)
|
||||
|
||||
Reference in New Issue
Block a user