Skip to content

Commit

Permalink
add retry logic and flag retry on flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ykim-1 committed Sep 19, 2024
1 parent 7886c08 commit 4860ab7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ dev = [
"requests-mock==1.12.1",
"boto3-stubs[s3]",
"build>=0.10.0",
"twine>=4.0.2"
"twine>=4.0.2",
"pytest-rerunfailures"
]

[project.scripts]
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/linodes/test_power_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
from tests.integration.helpers import delete_target_id, exec_test_command
from tests.integration.linodes.helpers_linodes import (
BASE_CMD,
create_linode,
create_linode_and_wait,
wait_until,
)


@pytest.fixture
def test_linode_id(linode_cloud_firewall):
linode_id = create_linode(firewall_id=linode_cloud_firewall)
linode_id = create_linode_and_wait(firewall_id=linode_cloud_firewall)

yield linode_id

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


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_shutdown_linode(test_linode_id):
linode_id = test_linode_id

Expand Down
1 change: 1 addition & 0 deletions tests/integration/linodes/test_rebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_linode_id(linode_cloud_firewall):
delete_target_id(target="linodes", id=linode_id)


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_rebuild_fails_without_image(test_linode_id):
linode_id = test_linode_id

Expand Down
1 change: 1 addition & 0 deletions tests/integration/linodes/test_resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_linode_id(linode_cloud_firewall):
delete_target_id(target="linodes", id=linode_id)


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_resize_fails_to_the_same_plan(test_linode_id):
linode_id = test_linode_id
linode_plan = (
Expand Down
1 change: 1 addition & 0 deletions tests/integration/lke/test_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def test_update_kubernetes_cluster(get_cluster_id):
assert new_label == updated_label


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_list_kubernetes_endpoint(get_cluster_id):
cluster_id = get_cluster_id
res = (
Expand Down

0 comments on commit 4860ab7

Please sign in to comment.