File: reap_dbs.py

package info (click to toggle)
alembic 1.13.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,976 kB
  • sloc: python: 37,768; makefile: 100; sh: 5
file content (26 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""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])