From 78b3278f6ed7a878f14af0ba155188f5e30d5f81 Mon Sep 17 00:00:00 2001 From: Maciej Wilk Date: Mon, 3 Aug 2026 13:21:06 +0200 Subject: [PATCH 1/6] Increase timeout for get_domain_status --- test/integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/conftest.py b/test/integration/conftest.py index a210fc20f..4503ca60e 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -316,7 +316,7 @@ def get_domain_status(): domain.invalidate() return domain.status == "active" - wait_for_condition(3, 30, get_domain_status) + wait_for_condition(3, 45, get_domain_status) # Create a SRV record domain.record_create( From cabdc62955752b8c3fff9ed61b37e63617766019 Mon Sep 17 00:00:00 2001 From: Maciej Wilk Date: Mon, 3 Aug 2026 13:21:43 +0200 Subject: [PATCH 2/6] Mark test_latest_get_event as flaky and increase latest_events list Decided mark test as flaky and increase latest_event list to 50 items because when it is run with TPT test user there is a high possibility that other tests may be run in the same time and produce many other events --- test/integration/models/account/test_account.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/integration/models/account/test_account.py b/test/integration/models/account/test_account.py index 286e9de06..47539d917 100644 --- a/test/integration/models/account/test_account.py +++ b/test/integration/models/account/test_account.py @@ -91,6 +91,8 @@ def test_update_maintenance_policy(test_linode_client): assert updated.maintenance_policy == original_policy +# May fail due to multiple events occurring on the test user in the same time +@pytest.mark.flaky(reruns=2, reruns_delay=5) @pytest.mark.smoke def test_latest_get_event(test_linode_client, e2e_test_firewall): client = test_linode_client @@ -115,7 +117,7 @@ def get_linode_status(): wait_for_condition(5, 150, get_linode_status) events = client.load(Event, "") - latest_events = events._raw_json.get("data")[:15] + latest_events = events._raw_json.get("data")[:50] linode.delete() @@ -123,7 +125,7 @@ def get_linode_status(): if label == event["entity"]["label"]: break else: - assert False, f"Linode '{label}' not found in the last 15 events" + assert False, f"Linode '{label}' not found in the last 50 events" def test_get_user(test_linode_client): From 08053bc1b9a47490785bb462fe6b17397e5c2afc Mon Sep 17 00:00:00 2001 From: Maciej Wilk Date: Wed, 5 Aug 2026 13:24:52 +0200 Subject: [PATCH 3/6] Add condition to get different region for migration --- test/integration/models/linode/test_linode.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index 55ae68880..563a808ba 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -641,8 +641,17 @@ def test_linode_ips(create_linode): def test_linode_initate_migration(test_linode_client, e2e_test_firewall): client = test_linode_client - region = get_region(client, {"Linodes", "Cloud Firewall"}, site_type="core") label = get_test_label() + "_migration" + region = get_region(client, {"Linodes", "Cloud Firewall"}, site_type="core") + region_migrate = get_region( + client, {"Linodes", "Cloud Firewall"}, site_type="core" + ) + + # Cannot migrate linode to the same region + while region_migrate == region: + region_migrate = get_region( + client, {"Linodes", "Cloud Firewall"}, site_type="core" + ) linode = client.linode.instance_create( "g6-nanode-1", @@ -657,7 +666,7 @@ def test_linode_initate_migration(test_linode_client, e2e_test_firewall): send_request_when_resource_available( 300, linode.initiate_migration, - region="us-central", + region=region_migrate, migration_type=MigrationType.COLD, ) From 702826d7ef99f8a9d3030e21c40c7324471e2720 Mon Sep 17 00:00:00 2001 From: Maciej Wilk Date: Wed, 5 Aug 2026 13:25:59 +0200 Subject: [PATCH 4/6] Add skip for test_get_login due to ongoing issue for TPT user --- test/integration/models/account/test_account.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/models/account/test_account.py b/test/integration/models/account/test_account.py index 47539d917..e771f2ca6 100644 --- a/test/integration/models/account/test_account.py +++ b/test/integration/models/account/test_account.py @@ -39,6 +39,9 @@ def test_get_account(test_linode_client): assert account_get.tax_id == account.tax_id +@pytest.mark.skip( + reason="Test fails for test user with [504] Gateway Timeout. More details: ARB-7420" +) def test_get_login(test_linode_client): client = test_linode_client login = retry_sending_request(3, client.load, Login(client, "", {}), "") From 265d3d316d3da340c679ac01d09f19fd15dd8779 Mon Sep 17 00:00:00 2001 From: Maciej Wilk Date: Wed, 5 Aug 2026 15:13:19 +0200 Subject: [PATCH 5/6] Increase timeouts in test_create_and_delete_vlan --- test/integration/models/networking/test_networking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/models/networking/test_networking.py b/test/integration/models/networking/test_networking.py index 0d028e6c3..18b6dabb1 100644 --- a/test/integration/models/networking/test_networking.py +++ b/test/integration/models/networking/test_networking.py @@ -304,14 +304,14 @@ def test_create_and_delete_vlan(test_linode_client, linode_for_vlan_tests): config.interfaces = [] config.save() - wait_for_condition(3, 100, get_status, linode, "running") + wait_for_condition(3, 150, get_status, linode, "running") retry_sending_request(3, linode.reboot) wait_for_condition(3, 100, get_status, linode, "rebooting") assert linode.status == "rebooting" - wait_for_condition(3, 100, get_status, linode, "running") + wait_for_condition(3, 150, get_status, linode, "running") # Delete the VLAN is_deleted = test_linode_client.networking.delete_vlan( From bd261c9d78182abd5e62ced43f7f49c5f6632cbb Mon Sep 17 00:00:00 2001 From: Maciej Wilk Date: Thu, 6 Aug 2026 09:24:01 +0200 Subject: [PATCH 6/6] Add try-except clause to create_image_id fixture --- .../models/sharegroups/test_sharegroups.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/integration/models/sharegroups/test_sharegroups.py b/test/integration/models/sharegroups/test_sharegroups.py index 1779c0469..f6421afcf 100644 --- a/test/integration/models/sharegroups/test_sharegroups.py +++ b/test/integration/models/sharegroups/test_sharegroups.py @@ -4,6 +4,7 @@ import pytest +from linode_api4.errors import ApiError from linode_api4.objects import ( Image, ImageShareGroup, @@ -33,7 +34,7 @@ def wait_for_image_status( ) -@pytest.fixture(scope="class") +@pytest.fixture(scope="module") def sample_linode(test_linode_client, e2e_test_firewall): client = test_linode_client region = get_region(client, {"Linodes", "Cloud Firewall"}, site_type="core") @@ -50,15 +51,22 @@ def sample_linode(test_linode_client, e2e_test_firewall): linode_instance.delete() -@pytest.fixture(scope="class") +@pytest.fixture(scope="module") def create_image_id(test_linode_client, sample_linode): create_image = test_linode_client.images.create( sample_linode.disks[0], label="linode-api4python-test-image-sharing-image", ) wait_for_image_status(test_linode_client, create_image.id, "available") + yield create_image.id - create_image.delete() + + try: + create_image.delete() + except ApiError as e: + # The image may already have been removed so we ignore [404] Not found + if e.status != 404: + raise @pytest.fixture(scope="function")