From d27330855593fe713aa162a2a748697617bde0aa Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 21 Jul 2019 14:12:12 -0400 Subject: Use SQLAlchemy's testing framework fully w/ 1.1 as the minimum version we should be able to remove the majority of the testing suite code Change-Id: I04c4ab45e2ce47f20613d6111895c6230b946f76 --- reap_dbs.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 reap_dbs.py (limited to 'reap_dbs.py') diff --git a/reap_dbs.py b/reap_dbs.py new file mode 100644 index 0000000..ae7ff85 --- /dev/null +++ b/reap_dbs.py @@ -0,0 +1,25 @@ +"""Drop Oracle, SQL Server databases that are left over from a +multiprocessing test run. + +Currently the cx_Oracle driver seems to sometimes not release a +TCP connection even if close() is called, which prevents the provisioning +system from dropping a database in-process. + +For SQL Server, databases still remain in use after tests run and +running a kill of all detected sessions does not seem to release the +database in process. + +""" +import logging +import sys + +from sqlalchemy.testing import provision + + +logging.basicConfig() +logging.getLogger(provision.__name__).setLevel(logging.INFO) + +if hasattr(provision, "reap_dbs"): + provision.reap_dbs(sys.argv[1]) +else: + provision.reap_oracle_dbs(sys.argv[1]) -- cgit v1.2.1