Fix lock range, again
This commit fixes lock range. We should get a lock before connecting to a database. Change-Id: Iecca74db980d3660248ad9dba6ddccd656f439bd
This commit is contained in:
committed by
Matthew Treinish
parent
0ed3e18acc
commit
5557641fea
@@ -138,10 +138,10 @@ class TestWalkMigrations(base.TestCase):
|
|||||||
self.fail("Shouldn't have connected")
|
self.fail("Shouldn't have connected")
|
||||||
|
|
||||||
def test_mysql_opportunistically(self):
|
def test_mysql_opportunistically(self):
|
||||||
|
self.useFixture(fixtures.LockFixture('mysql'))
|
||||||
if not db_test_utils.is_backend_avail('mysql'):
|
if not db_test_utils.is_backend_avail('mysql'):
|
||||||
raise self.skipTest('mysql is not available')
|
raise self.skipTest('mysql is not available')
|
||||||
|
|
||||||
self.useFixture(fixtures.LockFixture('mysql'))
|
|
||||||
self.useFixture(fixtures.MySQLConfFixture())
|
self.useFixture(fixtures.MySQLConfFixture())
|
||||||
# Test that table creation on mysql only builds InnoDB tables
|
# Test that table creation on mysql only builds InnoDB tables
|
||||||
# add this to the global lists to make reset work with it, it's removed
|
# add this to the global lists to make reset work with it, it's removed
|
||||||
@@ -182,9 +182,9 @@ class TestWalkMigrations(base.TestCase):
|
|||||||
|
|
||||||
def test_postgresql_opportunistically(self):
|
def test_postgresql_opportunistically(self):
|
||||||
# Test postgresql database migration walk
|
# Test postgresql database migration walk
|
||||||
|
self.useFixture(fixtures.LockFixture('postgres'))
|
||||||
if not db_test_utils.is_backend_avail('postgres'):
|
if not db_test_utils.is_backend_avail('postgres'):
|
||||||
raise self.skipTest('postgres is not available')
|
raise self.skipTest('postgres is not available')
|
||||||
self.useFixture(fixtures.LockFixture('postgres'))
|
|
||||||
self.useFixture(fixtures.PostgresConfFixture())
|
self.useFixture(fixtures.PostgresConfFixture())
|
||||||
# add this to the global lists to make reset work with it, it's removed
|
# add this to the global lists to make reset work with it, it's removed
|
||||||
# automatically in tearDown so no need to clean it up here.
|
# automatically in tearDown so no need to clean it up here.
|
||||||
|
|||||||
@@ -79,12 +79,12 @@ class TestModelsMigrations(test_migrations.ModelsMigrationsSync,
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestModelsMigrations, self).setUp()
|
super(TestModelsMigrations, self).setUp()
|
||||||
|
self.useFixture(fixtures.LockFixture(self.dialect))
|
||||||
if not db_test_utils.is_backend_avail(self.dialect):
|
if not db_test_utils.is_backend_avail(self.dialect):
|
||||||
raise self.skipTest('%s is not available' % self.dialect)
|
raise self.skipTest('%s is not available' % self.dialect)
|
||||||
if self.dialect == 'sqlite':
|
if self.dialect == 'sqlite':
|
||||||
raise self.skipException('sqlite skipped because of model sync '
|
raise self.skipException('sqlite skipped because of model sync '
|
||||||
'issue with BigInteger vs Integer')
|
'issue with BigInteger vs Integer')
|
||||||
self.useFixture(fixtures.LockFixture(self.dialect))
|
|
||||||
if self.dialect == 'mysql':
|
if self.dialect == 'mysql':
|
||||||
self.useFixture(fixtures.MySQLConfFixture())
|
self.useFixture(fixtures.MySQLConfFixture())
|
||||||
elif self.dialect == 'postgres':
|
elif self.dialect == 'postgres':
|
||||||
|
|||||||
Reference in New Issue
Block a user