Merge "Close and dispose test database setup connections"

This commit is contained in:
Jenkins 2015-07-27 15:39:59 +00:00 committed by Gerrit Code Review
commit b0c8b47ce7
2 changed files with 5 additions and 1 deletions

View File

@ -92,6 +92,8 @@ class PgSQLManager(SQLManager):
self._conn.execute( self._conn.execute(
'CREATE DATABASE %s WITH TEMPLATE template0;' % self._db_name) 'CREATE DATABASE %s WITH TEMPLATE template0;' % self._db_name)
self._conn.connection.set_isolation_level(1) self._conn.connection.set_isolation_level(1)
self._conn.close()
self._engine.dispose()
class MySQLManager(SQLManager): class MySQLManager(SQLManager):
@ -103,6 +105,8 @@ class MySQLManager(SQLManager):
self._url.replace('template1', '')) self._url.replace('template1', ''))
self._conn = self._engine.connect() self._conn = self._engine.connect()
self._conn.execute('CREATE DATABASE %s;' % self._db_name) self._conn.execute('CREATE DATABASE %s;' % self._db_name)
self._conn.close()
self._engine.dispose()
class ElasticSearchManager(fixtures.Fixture): class ElasticSearchManager(fixtures.Fixture):

View File

@ -27,7 +27,7 @@ PGSQL_PORT=9823
${PGSQL_PATH}/initdb -E UTF8 ${PGSQL_DATA} ${PGSQL_PATH}/initdb -E UTF8 ${PGSQL_DATA}
trap "clean_exit_pgsql ${PGSQL_PATH} ${PGSQL_DATA} ${PGSQL_PORT}" EXIT 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 CEILOMETER_TEST_PGSQL_URL="postgresql:///?host=${PGSQL_DATA}&port=${PGSQL_PORT}&dbname=template1" export CEILOMETER_TEST_PGSQL_URL="postgresql:///?host=${PGSQL_DATA}&port=${PGSQL_PORT}&dbname=template1"
# Yield execution to venv command # Yield execution to venv command