Don't create replicas2 vm in zuul

Zuul is not capable of creating 3 VM due to the lack of memory.

Change-Id: I180e7f8e4ab07998b3c0fc66fe2e316dd8d42aba
This commit is contained in:
wu.chunyang 2023-11-01 11:12:12 +08:00
parent d63e17a1c0
commit 711b04f792
2 changed files with 12 additions and 0 deletions

View File

@ -112,4 +112,12 @@ DatabaseGroup = [
'rebuild_image_id',
help="The new guest image ID used for rebuilding database instance."
),
cfg.BoolOpt(
"run_full_tests",
default=False,
help="Whether to run full tests for some tests. In the replication"
"test scenario, Trove will create 3 VMs for testing, In some"
"testing environment such as zuul, This will"
"cause the test to failed due to the lack of memory."
)
]

View File

@ -99,6 +99,10 @@ class TestReplicationBase(trove_base.BaseTroveTest):
new_db_names = [db['name'] for db in new_replica1_dbs]
self.assertIn(db_name, new_db_names)
# In the zuul environment, the testing VM can not create the
# replica2 vm due to the lack of memory.
if not CONF.database.run_full_tests:
return
# Create replica2
LOG.info(f"Creating replica2 for instance {self.instance_id}")
name = self.get_resource_name("replica-02")