diff --git a/aodh/tests/db.py b/aodh/tests/db.py index 2684d37e4..3d5fd515f 100644 --- a/aodh/tests/db.py +++ b/aodh/tests/db.py @@ -84,6 +84,8 @@ class PgSQLManager(SQLManager): self._conn.execute( 'CREATE DATABASE %s WITH TEMPLATE template0;' % self._db_name) self._conn.connection.set_isolation_level(1) + self._conn.close() + self._engine.dispose() class MySQLManager(SQLManager): @@ -95,6 +97,8 @@ class MySQLManager(SQLManager): self._url.replace('template1', '')) self._conn = self._engine.connect() self._conn.execute('CREATE DATABASE %s;' % self._db_name) + self._conn.close() + self._engine.dispose() class HBaseManager(fixtures.Fixture): diff --git a/setup-test-env-postgresql.sh b/setup-test-env-postgresql.sh index 34ef1f2eb..d688c4be7 100755 --- a/setup-test-env-postgresql.sh +++ b/setup-test-env-postgresql.sh @@ -27,7 +27,7 @@ PGSQL_PORT=9823 ${PGSQL_PATH}/initdb -E UTF8 ${PGSQL_DATA} trap "clean_exit_pgsql ${PGSQL_PATH} ${PGSQL_DATA} ${PGSQL_PORT}" EXIT -LANGUAGE=C ${PGSQL_PATH}/pg_ctl -w -D ${PGSQL_DATA} -o "-N 100 -F -k ${PGSQL_DATA} -p ${PGSQL_PORT}" start +LANGUAGE=C ${PGSQL_PATH}/pg_ctl -w -D ${PGSQL_DATA} -o "-F -k ${PGSQL_DATA} -p ${PGSQL_PORT}" start export AODH_TEST_PGSQL_URL="postgresql:///?host=${PGSQL_DATA}&port=${PGSQL_PORT}&dbname=template1" # Yield execution to venv command