diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-26 09:55:00 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-26 09:55:00 -0400 |
| commit | 3d6130d8e92dc3fd63e7192908e122fe5ee45699 (patch) | |
| tree | d6bdbd3e64b0aa9063153a0ad38ac037694e8469 /lib/sqlalchemy/dialects/postgresql/provision.py | |
| parent | 791f1d9407f68cc668c7078fa87784ebdf3bd688 (diff) | |
| download | sqlalchemy-3d6130d8e92dc3fd63e7192908e122fe5ee45699.tar.gz | |
turn pg provision error into a warning
We haven't had any real cases of the PG "cant drop tables"
condition since this error was first introduced; instead we
seem to get it for a non-critical query during pool reconnect
tests, and I have not been able to isolate what is causing it.
Therefore turn the error into a new class of warning that can
emit within the test suite without failing the test, so that
if we do get a real PG drop timeout, the warning will be there
to show us what the query was in which it was stuck.
Change-Id: I1a9b3c4f7a25b7b9c1af722a721fc44ad5575b0f
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/provision.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/provision.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/provision.py b/lib/sqlalchemy/dialects/postgresql/provision.py index 9196337ba..68a01e483 100644 --- a/lib/sqlalchemy/dialects/postgresql/provision.py +++ b/lib/sqlalchemy/dialects/postgresql/provision.py @@ -3,6 +3,7 @@ import time from ... import exc from ... import inspect from ... import text +from ...testing import warn_test_suite from ...testing.provision import create_db from ...testing.provision import drop_all_schema_objects_post_tables from ...testing.provision import drop_all_schema_objects_pre_tables @@ -118,8 +119,9 @@ def prepare_for_drop_tables(config, connection): "and pid != pg_backend_pid()" ) rows = result.all() # noqa - assert not rows, ( - "PostgreSQL may not be able to DROP tables due to " - "idle in transaction: %s" - % ("; ".join(row._mapping["query"] for row in rows)) - ) + if rows: + warn_test_suite( + "PostgreSQL may not be able to DROP tables due to " + "idle in transaction: %s" + % ("; ".join(row._mapping["query"] for row in rows)) + ) |
