Skip to content

Commit 221ac72

Browse files
committed
test_vm_life_cycle: Consider 600s threshold for expunge.delay as per server logic
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent bc40ed8 commit 221ac72

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

test/integration/smoke/test_vm_life_cycle.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -853,32 +853,27 @@ def test_09_expunge_vm(self):
853853
name='expunge.delay'
854854
)
855855

856-
response = config[0]
856+
expunge_delay = int(config[0].value)
857+
if expunge_delay < 600:
858+
expunge_delay = 600
857859
# Wait for some time more than expunge.delay
858-
time.sleep(int(response.value) * 2)
859-
860+
time.sleep(expunge_delay * 2)
861+
860862
#VM should be destroyed unless expunge thread hasn't run
861863
#Wait for two cycles of the expunge thread
862864
config = list_configurations(
863865
self.apiclient,
864866
name='expunge.interval'
865867
)
866-
expunge_cycle = int(config[0].value)*2
868+
expunge_cycle = int(config[0].value)
867869
if expunge_cycle < 600:
868-
expunge_cycle = 600*2
870+
expunge_cycle = 600
869871

870-
while expunge_cycle > 0:
871-
list_vm_response = list_virtual_machines(
872+
time.sleep(expunge_cycle * 2)
873+
list_vm_response = list_virtual_machines(
872874
self.apiclient,
873875
id=self.small_virtual_machine.id
874876
)
875-
if list_vm_response:
876-
time.sleep(expunge_cycle)
877-
expunge_cycle = 0
878-
continue
879-
else:
880-
break
881-
882877
self.assertEqual(
883878
list_vm_response,
884879
None,

0 commit comments

Comments
 (0)