Skip to content

Commit 4a3f37d

Browse files
authored
test: Add retry on flaky tests (#647)
1 parent b85cc93 commit 4a3f37d

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ dev = [
3333
"requests-mock==1.12.1",
3434
"boto3-stubs[s3]",
3535
"build>=0.10.0",
36-
"twine>=4.0.2"
36+
"twine>=4.0.2",
37+
"pytest-rerunfailures"
3738
]
3839

3940
[project.scripts]

tests/integration/linodes/test_power_status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
from tests.integration.helpers import delete_target_id, exec_test_command
44
from tests.integration.linodes.helpers_linodes import (
55
BASE_CMD,
6-
create_linode,
76
create_linode_and_wait,
87
wait_until,
98
)
109

1110

1211
@pytest.fixture
1312
def test_linode_id(linode_cloud_firewall):
14-
linode_id = create_linode(firewall_id=linode_cloud_firewall)
13+
linode_id = create_linode_and_wait(firewall_id=linode_cloud_firewall)
1514

1615
yield linode_id
1716

@@ -52,6 +51,7 @@ def test_reboot_linode(create_linode_in_running_state):
5251
), "Linode status has not changed to running from provisioning"
5352

5453

54+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
5555
def test_shutdown_linode(test_linode_id):
5656
linode_id = test_linode_id
5757

tests/integration/linodes/test_rebuild.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_linode_id(linode_cloud_firewall):
2525
delete_target_id(target="linodes", id=linode_id)
2626

2727

28+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
2829
def test_rebuild_fails_without_image(test_linode_id):
2930
linode_id = test_linode_id
3031

tests/integration/linodes/test_resize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def test_linode_id(linode_cloud_firewall):
4242
delete_target_id(target="linodes", id=linode_id)
4343

4444

45+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
4546
def test_resize_fails_to_the_same_plan(test_linode_id):
4647
linode_id = test_linode_id
4748
linode_plan = (

tests/integration/lke/test_clusters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def test_update_kubernetes_cluster(get_cluster_id):
132132
assert new_label == updated_label
133133

134134

135+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
135136
def test_list_kubernetes_endpoint(get_cluster_id):
136137
cluster_id = get_cluster_id
137138
res = (

0 commit comments

Comments
 (0)