Skip to content

Commit 725e62d

Browse files
Paul Angusyadvr
authored andcommitted
smoketests: fix intermittent tests
Add a pause to avoid tests restarting before VRs recovering from HA have fully booted.. Add some pauses to allow services to restart and hosts to reconnect before continuing tests. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent f430f41 commit 725e62d

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

test/integration/smoke/test_deploy_virtio_scsi_vm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def setUpClass(cls):
9696
cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
9797
cls.pod = get_pod(cls.apiclient, cls.zone.id)
9898
cls.services['mode'] = cls.zone.networktype
99+
cls.cleanup = []
99100
if cls.hypervisor.lower() not in ['kvm']:
100101
cls.hypervisorNotSupported = True
101102
return

test/integration/smoke/test_hostha_kvm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,12 @@ def test_hostha_enable_ha_when_host_in_maintenance(self):
274274
Tests Enable HA when host is in Maintenance mode, should be Ineligible
275275
"""
276276
self.logger.debug("Starting test_hostha_enable_ha_when_host_in_maintenance")
277-
277+
self.logger.debug("Pausing to wait for VMs to have finished starting")
278+
time.sleep(300)
279+
278280
# Enable HA
279281
self.configureAndEnableHostHa()
282+
280283

281284
# Prepare for maintenance Host
282285
self.setHostToMaintanance(self.host.id)

test/integration/smoke/test_vm_life_cycle.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ def setUpClass(cls):
839839

840840
@classmethod
841841
def tearDownClass(cls):
842+
time.sleep(120)
842843
cls.apiclient = super(TestSecuredVmMigration, cls).getClsTestClient().getApiClient()
843844
try:
844845
cleanup_resources(cls.apiclient, cls._cleanup)
@@ -866,7 +867,9 @@ def setUp(self):
866867
self.updateConfiguration("ca.plugin.root.auth.strictness", "false")
867868

868869
def tearDown(self):
870+
time.sleep(120)
869871
self.secure_all_hosts()
872+
time.sleep(120)
870873
self.updateConfiguration("ca.plugin.root.auth.strictness", "true")
871874
try:
872875
cleanup_resources(self.apiclient, self.cleanup)
@@ -907,9 +910,10 @@ def unsecure_host(self, host):
907910
sed -i 's/listen_tcp.*/listen_tcp=1/g' /etc/libvirt/libvirtd.conf && \
908911
sed -i '/.*_file=.*/d' /etc/libvirt/libvirtd.conf && \
909912
service libvirtd restart && \
913+
sleep 30 && \
910914
service cloudstack-agent restart")
911-
912-
time.sleep(10)
915+
916+
time.sleep(120)
913917
self.check_connection(host=host, secured='false')
914918
return host
915919

0 commit comments

Comments
 (0)