We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bec88d commit 7b12d1eCopy full SHA for 7b12d1e
services/web/server/tests/unit/with_dbs/conftest.py
@@ -527,7 +527,17 @@ def postgres_db(
527
with engine.begin() as conn:
528
conn.execute(sa.DDL("DROP TABLE IF EXISTS alembic_version"))
529
530
- orm.metadata.drop_all(engine)
+ conn.execute(
531
+ # NOTE: terminates all open transactions before droping all tables
532
+ # This solves https://github.com/ITISFoundation/osparc-simcore/issues/7008
533
+ sa.DDL(
534
+ "SELECT pg_terminate_backend(pid) "
535
+ "FROM pg_stat_activity "
536
+ "WHERE state = 'idle in transaction';"
537
+ )
538
539
+ orm.metadata.drop_all(bind=conn)
540
+
541
engine.dispose()
542
543
0 commit comments