Add lockutils fixture to OpportunisticTestCase

We're getting hit hard with db race problems right now and the
proper fix can't go in until infra has all of their regions
updated.  Using the lock fixture to serialize all of the db tests
should help with the problem until infra is ready.

Change-Id: If883832b0eba08f1508a247310b8eebd67b27971
Partial-Bug: #1288916
This commit is contained in:
Ben Nemec 2014-03-11 16:01:33 +00:00
parent d65337d258
commit f05a883614
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import six
from openstack.common.db.sqlalchemy import session
from openstack.common.db.sqlalchemy import utils
from openstack.common.fixture import lockutils
from openstack.common import test
@ -120,6 +121,9 @@ class OpportunisticTestCase(DbTestCase):
FIXTURE = abc.abstractproperty(lambda: None)
def setUp(self):
# TODO(bnemec): Remove this once infra is ready for
# https://review.openstack.org/#/c/74963/ to merge.
self.useFixture(lockutils.LockFixture('opportunistic-db'))
credentials = {
'backend': self.FIXTURE.DRIVER,
'user': self.FIXTURE.USERNAME,