You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sh...@apache.org on 2023/10/05 06:18:45 UTC

[cloudstack] branch main updated: Add extra checks for test_vm_schedule to avoid intermittent failures (#8036)

This is an automated email from the ASF dual-hosted git repository.

shwstppr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new b9e423b7a9e Add extra checks for test_vm_schedule to avoid intermittent failures (#8036)
b9e423b7a9e is described below

commit b9e423b7a9e9d585b0e2607f7205b8c6c40508c9
Author: Vishesh <vi...@gmail.com>
AuthorDate: Thu Oct 5 11:48:37 2023 +0530

    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
---
 test/integration/smoke/test_vm_schedule.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/integration/smoke/test_vm_schedule.py b/test/integration/smoke/test_vm_schedule.py
index bd699cf4d2b..ee1354ff80e 100644
--- a/test/integration/smoke/test_vm_schedule.py
+++ b/test/integration/smoke/test_vm_schedule.py
@@ -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)
                 )