|
1 | 1 | import pytest |
2 | 2 |
|
3 | | -from tests.integration.helpers import delete_target_id, exec_test_command |
| 3 | +from tests.integration.helpers import ( |
| 4 | + delete_target_id, |
| 5 | + exec_test_command, |
| 6 | + retry_exec_test_command_with_delay, |
| 7 | +) |
4 | 8 | from tests.integration.linodes.helpers_linodes import ( |
5 | 9 | BASE_CMD, |
6 | 10 | create_linode_and_wait, |
@@ -45,19 +49,21 @@ def test_create_linode_and_boot(test_linode_id): |
45 | 49 | assert result, "Linode status has not changed to running from provisioning" |
46 | 50 |
|
47 | 51 |
|
| 52 | +@pytest.mark.flaky(reruns=3, reruns_delay=2) |
48 | 53 | def test_reboot_linode(create_linode_in_running_state_for_reboot): |
49 | 54 | # create linode and wait until it is in "running" state |
50 | 55 | linode_id = create_linode_in_running_state_for_reboot |
| 56 | + # In case if the linode is not ready to reboot |
| 57 | + wait_until(linode_id=linode_id, timeout=240, status="running") |
51 | 58 |
|
52 | 59 | # reboot linode from "running" status |
53 | | - exec_test_command( |
54 | | - BASE_CMD + ["reboot", linode_id, "--text", "--no-headers"] |
| 60 | + retry_exec_test_command_with_delay( |
| 61 | + BASE_CMD + ["reboot", linode_id, "--text", "--no-headers"], 3, 20 |
55 | 62 | ) |
56 | 63 |
|
57 | | - # returns false if status is not running after 240s after reboot |
58 | 64 | assert wait_until( |
59 | 65 | linode_id=linode_id, timeout=240, status="running" |
60 | | - ), "Linode status has not changed to running from provisioning" |
| 66 | + ), "Linode status has not changed to running from provisioning after reboot" |
61 | 67 |
|
62 | 68 |
|
63 | 69 | @pytest.mark.flaky(reruns=3, reruns_delay=2) |
|
0 commit comments