Add extra checks for test_vm_schedule to avoid intermittent failures (#8036)

This PR adds additional checks in test_vm_schedule to avoid intermittent failures
This commit is contained in:
Vishesh 2023-10-05 11:48:37 +05:30 committed by GitHub
parent e21b8882e4
commit b9e423b7a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -596,6 +596,10 @@ class TestVMSchedule(cloudstackTestCase):
time.sleep(30)
current_state = self.virtual_machine.update(self.apiclient).state
if previous_state != current_state:
# Add these checks because VMs can take some time to start or stop
if (previous_state == 'Starting' and current_state in ('Starting', 'Running')) or (
previous_state == 'Stopping' and current_state in ('Stopping', 'Stopped')):
continue
self.debug(
"VM changed state from %s to %s" % (previous_state, current_state)
)