Skip to content

Commit a4c778e

Browse files
committed
test_vm_life_cycle: Don't wait a lot poll for change every expunge_cycle interval
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 1450547 commit a4c778e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎test/integration/smoke/test_vm_life_cycle.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,18 @@ def test_09_expunge_vm(self):
869869
if expunge_cycle < 600:
870870
expunge_cycle = 600
871871

872-
time.sleep(expunge_cycle * 2)
873-
list_vm_response = list_virtual_machines(
872+
wait_time = expunge_cycle * 2
873+
while wait_time >= 0:
874+
list_vm_response = list_virtual_machines(
874875
self.apiclient,
875876
id=self.small_virtual_machine.id
876877
)
878+
if list_vm_response:
879+
time.sleep(expunge_cycle)
880+
wait_time = wait_time - expunge_cycle
881+
else:
882+
break
883+
877884
self.assertEqual(
878885
list_vm_response,
879886
None,

0 commit comments

Comments
 (0)