From 7fd38d44c0d9fd6d77b74a6d72efa97315768d16 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 13:24:43 +1100 Subject: [PATCH 1/6] fix(compute): change secondary disk creation to match primary In some cases this was hardcoded, in others it was defaulted to pd-ssd. In all cases, the primary was pd-balanced, and these tests failed --- compute/client_library/snippets/tests/test_disks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compute/client_library/snippets/tests/test_disks.py b/compute/client_library/snippets/tests/test_disks.py index 0627ff8e2b2..b213a4d3691 100644 --- a/compute/client_library/snippets/tests/test_disks.py +++ b/compute/client_library/snippets/tests/test_disks.py @@ -460,7 +460,7 @@ def test_create_secondary(test_empty_pd_balanced_disk, autodelete_disk_name): secondary_disk_project=PROJECT, secondary_disk_zone=ZONE, disk_size_gb=DISK_SIZE, - disk_type="pd-ssd", + disk_type="pd-balanced", ) assert disk.async_primary_disk.disk == test_empty_pd_balanced_disk.self_link @@ -476,7 +476,7 @@ def test_create_custom_secondary_disk( secondary_disk_project=PROJECT, secondary_disk_zone=ZONE, disk_size_gb=DISK_SIZE, - disk_type="pd-ssd", + disk_type="pd-balanced", ) assert disk.labels["secondary-disk-for-replication"] == "true" assert disk.labels["source-disk"] == test_empty_pd_balanced_disk.name @@ -504,6 +504,7 @@ def test_start_stop_region_replication( PROJECT, REGION_SECONDARY, DISK_SIZE, + disk_type="pb-balanced" ) assert start_disk_replication( project_id=PROJECT, @@ -530,6 +531,7 @@ def test_start_stop_zone_replication(test_empty_pd_balanced_disk, autodelete_dis PROJECT, ZONE, DISK_SIZE, + disk_type="pb-balanced" ) assert start_disk_replication( project_id=PROJECT, From 39604116d12a25cb7a12b4b80506d43026ef964d Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 13:25:52 +1100 Subject: [PATCH 2/6] fix(compute): update to latest ubuntu lts --- .../snippets/tests/test_instance_from_template.py | 2 +- .../snippets/tests/test_instance_suspend_resume.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compute/client_library/snippets/tests/test_instance_from_template.py b/compute/client_library/snippets/tests/test_instance_from_template.py index 9a3ba8775a1..31ed6996462 100644 --- a/compute/client_library/snippets/tests/test_instance_from_template.py +++ b/compute/client_library/snippets/tests/test_instance_from_template.py @@ -88,7 +88,7 @@ def test_create_instance_from_template_override( image_client = compute_v1.ImagesClient() image = image_client.get_from_family( - project="ubuntu-os-cloud", family="ubuntu-2004-lts" + project="ubuntu-os-cloud", family="ubuntu-2404-lts" ) instance = create_instance_from_template_with_overrides( PROJECT, diff --git a/compute/client_library/snippets/tests/test_instance_suspend_resume.py b/compute/client_library/snippets/tests/test_instance_suspend_resume.py index 54ac3324a73..9c509a447a5 100644 --- a/compute/client_library/snippets/tests/test_instance_suspend_resume.py +++ b/compute/client_library/snippets/tests/test_instance_suspend_resume.py @@ -41,7 +41,7 @@ def _get_status(instance: compute_v1.Instance) -> compute_v1.Instance.Status: def compute_instance(): instance_name = "test-instance-" + uuid.uuid4().hex[:10] newest_debian = get_image_from_family( - project="ubuntu-os-cloud", family="ubuntu-2004-lts" + project="ubuntu-os-cloud", family="ubuntu-2404-lts" ) disk_type = f"zones/{INSTANCE_ZONE}/diskTypes/pd-standard" disks = [disk_from_image(disk_type, 100, True, newest_debian.self_link)] From a3da12d65607c2832dba08b704113cbf71e8114f Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 15:10:14 +1100 Subject: [PATCH 3/6] correct disk type --- compute/client_library/snippets/tests/test_disks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compute/client_library/snippets/tests/test_disks.py b/compute/client_library/snippets/tests/test_disks.py index b213a4d3691..b846296fa91 100644 --- a/compute/client_library/snippets/tests/test_disks.py +++ b/compute/client_library/snippets/tests/test_disks.py @@ -504,7 +504,7 @@ def test_start_stop_region_replication( PROJECT, REGION_SECONDARY, DISK_SIZE, - disk_type="pb-balanced" + disk_type="pd-balanced" ) assert start_disk_replication( project_id=PROJECT, @@ -531,7 +531,7 @@ def test_start_stop_zone_replication(test_empty_pd_balanced_disk, autodelete_dis PROJECT, ZONE, DISK_SIZE, - disk_type="pb-balanced" + disk_type="pd-balanced" ) assert start_disk_replication( project_id=PROJECT, From 77053e1045df1349ba7adb2e8c2b433470e81e4b Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 15:12:34 +1100 Subject: [PATCH 4/6] correct image name Use later ubuntu images split on arch --- .../snippets/tests/test_instance_from_template.py | 2 +- .../snippets/tests/test_instance_suspend_resume.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compute/client_library/snippets/tests/test_instance_from_template.py b/compute/client_library/snippets/tests/test_instance_from_template.py index 31ed6996462..f1a87da07e9 100644 --- a/compute/client_library/snippets/tests/test_instance_from_template.py +++ b/compute/client_library/snippets/tests/test_instance_from_template.py @@ -88,7 +88,7 @@ def test_create_instance_from_template_override( image_client = compute_v1.ImagesClient() image = image_client.get_from_family( - project="ubuntu-os-cloud", family="ubuntu-2404-lts" + project="ubuntu-os-cloud", family="ubuntu-2204-lts" ) instance = create_instance_from_template_with_overrides( PROJECT, diff --git a/compute/client_library/snippets/tests/test_instance_suspend_resume.py b/compute/client_library/snippets/tests/test_instance_suspend_resume.py index 9c509a447a5..b5491904bd5 100644 --- a/compute/client_library/snippets/tests/test_instance_suspend_resume.py +++ b/compute/client_library/snippets/tests/test_instance_suspend_resume.py @@ -41,7 +41,7 @@ def _get_status(instance: compute_v1.Instance) -> compute_v1.Instance.Status: def compute_instance(): instance_name = "test-instance-" + uuid.uuid4().hex[:10] newest_debian = get_image_from_family( - project="ubuntu-os-cloud", family="ubuntu-2404-lts" + project="ubuntu-os-cloud", family="ubuntu-2204-lts" ) disk_type = f"zones/{INSTANCE_ZONE}/diskTypes/pd-standard" disks = [disk_from_image(disk_type, 100, True, newest_debian.self_link)] From e9b0a5815d20862e066f854cf280307a8e6eff50 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 17:14:06 +1100 Subject: [PATCH 5/6] add missing disk_type updates from create_secondary_region_disk usage --- compute/client_library/snippets/tests/test_disks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compute/client_library/snippets/tests/test_disks.py b/compute/client_library/snippets/tests/test_disks.py index b846296fa91..c7477431b0e 100644 --- a/compute/client_library/snippets/tests/test_disks.py +++ b/compute/client_library/snippets/tests/test_disks.py @@ -447,6 +447,7 @@ def test_create_secondary_region( PROJECT, REGION_SECONDARY, DISK_SIZE, + disk_type="pd-balanced" ) assert disk.async_primary_disk.disk == autodelete_regional_blank_disk.self_link @@ -651,6 +652,7 @@ def test_stop_replications_in_consistency_group( PROJECT, REGION_SECONDARY, DISK_SIZE, + disk_type="pd-balanced" ) start_disk_replication( project_id=PROJECT, From 26b6a929d2b8cdd387296866fc73ffa7b52b8960 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Mon, 20 Oct 2025 17:14:42 +1100 Subject: [PATCH 6/6] missing commit --- compute/client_library/snippets/tests/test_disks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/compute/client_library/snippets/tests/test_disks.py b/compute/client_library/snippets/tests/test_disks.py index c7477431b0e..2a8fa88e79b 100644 --- a/compute/client_library/snippets/tests/test_disks.py +++ b/compute/client_library/snippets/tests/test_disks.py @@ -590,6 +590,7 @@ def test_clone_disks_in_consistency_group( PROJECT, REGION_SECONDARY, DISK_SIZE, + disk_type="pd-balanced" ) add_disk_consistency_group(