From 406892f7b16042c675171c911b14cfd6820231a7 Mon Sep 17 00:00:00 2001 From: Ye Chen Date: Wed, 9 Sep 2026 10:06:22 -0400 Subject: [PATCH 1/4] fix test --- test/integration/models/linode/test_linode.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index 566bab577..32f2d288e 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -134,15 +134,19 @@ def linode_for_vpu_tests(test_linode_client, e2e_test_firewall): pytest.skip("No VPU capacity is currently available") label = get_test_label(length=8) - - linode_instance = client.linode.instance_create( - vpu_type, - region, - image="linode/debian12", - label=label, - firewall=e2e_test_firewall, - root_pass="aComplex@Password123", - ) + try: + linode_instance = client.linode.instance_create( + vpu_type, + region, + image="linode/debian12", + label=label, + firewall=e2e_test_firewall, + root_pass="aComplex@Password123", + ) + except ApiError as e: + if e.status == 400 and "The Linode plan you chose is not currently available in the selected region" in str(e): + pytest.skip("No VPU capacity is currently available") + raise yield linode_instance From d13c9044b1b24890a18106106f71b10072be092a Mon Sep 17 00:00:00 2001 From: Ye Chen Date: Wed, 9 Sep 2026 10:27:17 -0400 Subject: [PATCH 2/4] fix create vpc --- test/integration/conftest.py | 2 ++ test/integration/models/linode/test_linode.py | 31 +++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/test/integration/conftest.py b/test/integration/conftest.py index c9982e17d..3cdc14641 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -479,7 +479,9 @@ def create_vpc(test_linode_client): "VPC IPv6 Stack", "Linode Interfaces", "Custom VPC IPv4 Ranges", + "Linodes", }, + site_type="core", ), description="test description", ipv6=[{"range": "auto"}], diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index 32f2d288e..d2ea9a183 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -144,7 +144,9 @@ def linode_for_vpu_tests(test_linode_client, e2e_test_firewall): root_pass="aComplex@Password123", ) except ApiError as e: - if e.status == 400 and "The Linode plan you chose is not currently available in the selected region" in str(e): + reasons = e.errors or [str(e)] + unavailable_msg = "not currently available in the selected region" + if e.status == 400 and any(unavailable_msg in r for r in reasons): pytest.skip("No VPU capacity is currently available") raise @@ -1023,18 +1025,21 @@ def test_create_vpc( # TODO:: Add `VPCIPAddress.filters.linode_id == linode.id` filter back - # Attempt to resolve the IP from /vpcs/ips - all_vpc_ips = test_linode_client.vpcs.ips() - matched_ip = next( - ( - ip - for ip in all_vpc_ips - if ip.address == vpc_ip.address - and ip.vpc_id == vpc_ip.vpc_id - and ip.linode_id == vpc_ip.linode_id - ), - None, - ) + # Attempt to resolve the IP from /vpcs/ips. The account-wide listing + # may lag behind instance creation, so poll until the IP appears. + def resolve_vpc_ip(): + return next( + ( + ip + for ip in test_linode_client.vpcs.ips() + if ip.address == vpc_ip.address + and ip.vpc_id == vpc_ip.vpc_id + and ip.linode_id == vpc_ip.linode_id + ), + None, + ) + + matched_ip = wait_for_condition(5, 120, resolve_vpc_ip) assert ( matched_ip is not None From ecfc1b2e2938dad6b325ac36bff43a46f31d2496 Mon Sep 17 00:00:00 2001 From: Ye Chen Date: Wed, 9 Sep 2026 10:47:25 -0400 Subject: [PATCH 3/4] fix plan --- test/integration/conftest.py | 1 - test/integration/models/linode/test_linode.py | 34 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 3cdc14641..6470d9df1 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -481,7 +481,6 @@ def create_vpc(test_linode_client): "Custom VPC IPv4 Ranges", "Linodes", }, - site_type="core", ), description="test description", ipv6=[{"range": "auto"}], diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index d2ea9a183..ae77bacb0 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -102,7 +102,7 @@ def linode_and_vpc_for_legacy_interface_tests_offline( label = get_test_label(length=8) instance = test_linode_client.linode.instance_create( - "g6-standard-1", + "g5-standard-1", vpc.region, booted=False, image="linode/debian11", @@ -1054,21 +1054,23 @@ def resolve_vpc_ip(): assert vpc_ips[0].linode_id == linode.id assert vpc_ips[0].nat_1_1 == linode.ips.ipv4.public[0].address - # Validate VPC IPv6 IPs from /vpcs/ips - all_vpc_ipv6 = test_linode_client.get("/vpcs/ipv6s")["data"] - - # Find matching VPC IPv6 entry - matched_ipv6 = next( - ( - ip - for ip in all_vpc_ipv6 - if ip["vpc_id"] == vpc.id - and ip["linode_id"] == linode.id - and ip["interface_id"] == interface.id - and ip["subnet_id"] == subnet.id - ), - None, - ) + # Validate VPC IPv6 IPs from /vpcs/ipv6s. The account-wide listing may + # lag behind instance creation, so poll until the entry appears. + def resolve_vpc_ipv6(): + all_vpc_ipv6 = test_linode_client.get("/vpcs/ipv6s")["data"] + return next( + ( + ip + for ip in all_vpc_ipv6 + if ip["vpc_id"] == vpc.id + and ip["linode_id"] == linode.id + and ip["interface_id"] == interface.id + and ip["subnet_id"] == subnet.id + ), + None, + ) + + matched_ipv6 = wait_for_condition(5, 120, resolve_vpc_ipv6) assert ( matched_ipv6 From fc42c31032b2ab16f864adb653c84d782d2cf8c3 Mon Sep 17 00:00:00 2001 From: Ye Chen Date: Wed, 9 Sep 2026 10:54:51 -0400 Subject: [PATCH 4/4] add timeout catch --- test/integration/models/linode/test_linode.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/integration/models/linode/test_linode.py b/test/integration/models/linode/test_linode.py index ae77bacb0..0d607223b 100644 --- a/test/integration/models/linode/test_linode.py +++ b/test/integration/models/linode/test_linode.py @@ -1039,7 +1039,10 @@ def resolve_vpc_ip(): None, ) - matched_ip = wait_for_condition(5, 120, resolve_vpc_ip) + try: + matched_ip = wait_for_condition(5, 120, resolve_vpc_ip) + except TimeoutError: + matched_ip = None assert ( matched_ip is not None @@ -1070,7 +1073,10 @@ def resolve_vpc_ipv6(): None, ) - matched_ipv6 = wait_for_condition(5, 120, resolve_vpc_ipv6) + try: + matched_ipv6 = wait_for_condition(5, 120, resolve_vpc_ipv6) + except TimeoutError: + matched_ipv6 = None assert ( matched_ipv6