postgresql-testing 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {postgresql_testing-0.0.2 → postgresql_testing-0.0.3}/PKG-INFO +1 -1
- {postgresql_testing-0.0.2 → postgresql_testing-0.0.3}/pyproject.toml +1 -1
- {postgresql_testing-0.0.2 → postgresql_testing-0.0.3}/src/postgresql_testing/__init__.py +9 -1
- {postgresql_testing-0.0.2 → postgresql_testing-0.0.3}/README.md +0 -0
- {postgresql_testing-0.0.2 → postgresql_testing-0.0.3}/src/postgresql_testing/py.typed +0 -0
|
@@ -116,8 +116,16 @@ def serve(c: ClusterConfig) -> Iterator[None]:
|
|
|
116
116
|
_try_connect(c.superuser().dsn)
|
|
117
117
|
yield
|
|
118
118
|
finally:
|
|
119
|
+
# Stop any ongoing queries
|
|
120
|
+
with psycopg.connect(c.superuser().dsn) as conn, conn.cursor() as cur:
|
|
121
|
+
cur.execute("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid()")
|
|
122
|
+
# Shutdown
|
|
119
123
|
process.terminate()
|
|
120
|
-
|
|
124
|
+
try:
|
|
125
|
+
process.wait(timeout=1)
|
|
126
|
+
except subprocess.TimeoutExpired:
|
|
127
|
+
process.kill()
|
|
128
|
+
process.wait(timeout=5)
|
|
121
129
|
|
|
122
130
|
|
|
123
131
|
def ensure_user(c: DatabaseConfig) -> None:
|
|
File without changes
|
|
File without changes
|