test(io): move remaining tests in test_io.py to their modules
We had just 3 tests remaining in test_io.py. This commit moves them to their modules. So we have: * test_graceful_shutdown.py * test_zero_downtime.py * test_pg_internal.py Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from util import psql_as_superuser
|
||||
from postgrest import run
|
||||
|
||||
|
||||
def test_listener_query_is_visible_in_pg_stat_activity(defaultenv):
|
||||
"The listener connection should show the LISTEN pgrst statement in pg_stat_activity"
|
||||
|
||||
env = {
|
||||
**defaultenv,
|
||||
"PGRST_DB_CHANNEL_ENABLED": "true",
|
||||
"PGAPPNAME": "listener-query-test",
|
||||
}
|
||||
|
||||
with run(env=env):
|
||||
output = psql_as_superuser(
|
||||
"""
|
||||
select query
|
||||
from pg_stat_activity
|
||||
where application_name = 'listener-query-test'
|
||||
and query = 'LISTEN "pgrst"'
|
||||
limit 1;
|
||||
""",
|
||||
capture_output=True,
|
||||
).strip()
|
||||
|
||||
assert output == 'LISTEN "pgrst"'
|
||||
Reference in New Issue
Block a user