Skip to content

Commit 6ca908e

Browse files
ezilber-akamaisusharma-beep
authored andcommitted
Fixed failure in test_resize_fails_to_smaller_volume (#867)
1 parent 2c42de1 commit 6ca908e

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

tests/integration/volumes/fixtures.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
delete_target_id,
66
exec_test_command,
77
get_random_text,
8+
wait_for_condition,
89
)
910

1011

@@ -30,6 +31,23 @@ def volume_instance_id():
3031
]
3132
)
3233

34+
def poll_volume_status():
35+
status = exec_test_command(
36+
BASE_CMDS["volumes"]
37+
+ [
38+
"view",
39+
volume_id,
40+
"--text",
41+
"--no-headers",
42+
"--format=status",
43+
]
44+
)
45+
return status.strip() == "active"
46+
47+
wait_for_condition(10, 240, poll_volume_status)
48+
3349
yield volume_id
3450

35-
delete_target_id(target="volumes", id=volume_id)
51+
delete_target_id(
52+
target="volumes", id=volume_id, use_retry=True, retries=5, delay=15
53+
)

tests/integration/volumes/test_volumes_resize.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import time
32

43
from linodecli.exit_codes import ExitCodes
54
from tests.integration.helpers import (
@@ -12,7 +11,6 @@
1211

1312
def test_resize_fails_to_smaller_volume(volume_instance_id):
1413
volume_id = volume_instance_id
15-
time.sleep(5)
1614
result = exec_failing_test_command(
1715
BASE_CMDS["volumes"]
1816
+ ["resize", volume_id, "--size", "5", "--text", "--no-headers"],

0 commit comments

Comments
 (0)