Skip to content

Commit

Permalink
Adding retries for flaky tests (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykim-akamai authored Sep 25, 2024
1 parent b91f188 commit dddecc8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/integration/linode_client/test_linode_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_get_regions(test_linode_client):


@pytest.mark.smoke
@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_image_create(setup_client_and_linode):
client = setup_client_and_linode[0]
linode = setup_client_and_linode[1]
Expand Down
1 change: 1 addition & 0 deletions test/integration/models/image/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def test_image_create_upload(test_linode_client, test_uploaded_image):


@pytest.mark.smoke
@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_image_replication(test_linode_client, test_uploaded_image):
uploaded_image, regions = test_uploaded_image

Expand Down
3 changes: 3 additions & 0 deletions test/integration/models/linode/test_linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def test_linode_boot(create_linode):
assert linode.status == "running"


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_linode_resize(create_linode_for_long_running_tests):
linode = create_linode_for_long_running_tests

Expand Down Expand Up @@ -590,6 +591,7 @@ def test_get_linode_types_overrides(test_linode_client):
assert linode_type.region_prices[0].monthly >= 0


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_save_linode_noforce(test_linode_client, create_linode):
linode = create_linode
old_label = linode.label
Expand All @@ -601,6 +603,7 @@ def test_save_linode_noforce(test_linode_client, create_linode):
assert old_label != linode.label


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_save_linode_force(test_linode_client, create_linode):
linode = create_linode
old_label = linode.label
Expand Down
1 change: 1 addition & 0 deletions test/integration/models/lke/test_lke.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def test_lke_cluster_acl(lke_cluster_with_acl):
assert not cluster.control_plane_acl.enabled


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_lke_cluster_labels_and_taints(lke_cluster_with_labels_and_taints):
pool = lke_cluster_with_labels_and_taints.pools[0]

Expand Down
4 changes: 4 additions & 0 deletions test/integration/models/profile/test_profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from linode_api4.objects import PersonalAccessToken, Profile, SSHKey


Expand All @@ -18,6 +20,7 @@ def test_get_personal_access_token_objects(test_linode_client):
assert isinstance(personal_access_tokens[0], PersonalAccessToken)


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_get_sshkeys(test_linode_client, test_sshkey):
client = test_linode_client

Expand All @@ -29,6 +32,7 @@ def test_get_sshkeys(test_linode_client, test_sshkey):
assert test_sshkey.label in ssh_labels


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_ssh_key_create(test_sshkey, ssh_key_gen):
pub_key = ssh_key_gen[0]
key = test_sshkey
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ deps =
mock
pylint
httpretty
pytest-rerunfailures
commands =
python -m pip install .
coverage run --source linode_api4 -m pytest test/unit
Expand Down

0 comments on commit dddecc8

Please sign in to comment.