Fixes the failing unit-tests
The tests were failing because of multiple processes used by testr while executing the tests. These multiple processes used to run multiple setUp/setUpClass before the execution of complimentary tearDown/tearDownClass. Updated tests to use unique names for datastore and datastore version, by substituting the uuid with name to make it unique. Change-Id: I6c4228c0e540dc9d1f5f310a919ee32decb7cc94 Closes-Bug: #1468883
This commit is contained in:
@@ -116,13 +116,13 @@ class CreateInstanceTest(trove_testtools.TestCase):
|
||||
self.users = []
|
||||
self.datastore = datastore_models.DBDatastore.create(
|
||||
id=str(uuid.uuid4()),
|
||||
name='mysql',
|
||||
name='mysql' + str(uuid.uuid4()),
|
||||
)
|
||||
self.datastore_version = (
|
||||
datastore_models.DBDatastoreVersion.create(
|
||||
id=str(uuid.uuid4()),
|
||||
datastore_id=self.datastore.id,
|
||||
name="5.5",
|
||||
name="5.5" + str(uuid.uuid4()),
|
||||
manager="mysql",
|
||||
image_id="image_id",
|
||||
packages="",
|
||||
@@ -220,12 +220,12 @@ class TestReplication(trove_testtools.TestCase):
|
||||
|
||||
self.datastore = datastore_models.DBDatastore.create(
|
||||
id=str(uuid.uuid4()),
|
||||
name='name',
|
||||
name='name' + str(uuid.uuid4()),
|
||||
default_version_id=str(uuid.uuid4()))
|
||||
|
||||
self.datastore_version = datastore_models.DBDatastoreVersion.create(
|
||||
id=self.datastore.default_version_id,
|
||||
name='name',
|
||||
name='name' + str(uuid.uuid4()),
|
||||
image_id=str(uuid.uuid4()),
|
||||
packages=str(uuid.uuid4()),
|
||||
datastore_id=self.datastore.id,
|
||||
|
||||
@@ -49,13 +49,13 @@ class BaseInstanceStatusTestCase(trove_testtools.TestCase):
|
||||
ServiceStatuses.RUNNING)
|
||||
self.datastore = models.DBDatastore.create(
|
||||
id=str(uuid.uuid4()),
|
||||
name='mysql',
|
||||
name='mysql' + str(uuid.uuid4()),
|
||||
default_version_id=self.db_info.datastore_version_id
|
||||
)
|
||||
self.version = models.DBDatastoreVersion.create(
|
||||
id=self.db_info.datastore_version_id,
|
||||
datastore_id=self.datastore.id,
|
||||
name='5.5',
|
||||
name='5.5' + str(uuid.uuid4()),
|
||||
manager='mysql',
|
||||
image_id=str(uuid.uuid4()),
|
||||
active=1,
|
||||
|
||||
@@ -48,13 +48,13 @@ class MockMgmtInstanceTest(trove_testtools.TestCase):
|
||||
cls.version_id = str(uuid.uuid4())
|
||||
cls.datastore = datastore_models.DBDatastore.create(
|
||||
id=str(uuid.uuid4()),
|
||||
name='mysql',
|
||||
name='mysql' + str(uuid.uuid4()),
|
||||
default_version_id=cls.version_id
|
||||
)
|
||||
cls.version = datastore_models.DBDatastoreVersion.create(
|
||||
id=cls.version_id,
|
||||
datastore_id=cls.datastore.id,
|
||||
name='5.5',
|
||||
name='5.5' + str(uuid.uuid4()),
|
||||
manager='mysql',
|
||||
image_id=str(uuid.uuid4()),
|
||||
active=1,
|
||||
|
||||
Reference in New Issue
Block a user