Skip to content

Speed up post-test cleanup: region-scope and gate LB scans#509

Merged
copybara-service[bot] merged 3 commits into
GoogleCloudPlatform:mainfrom
jonathanspw:region-scope-lb-cleanup
Jun 5, 2026
Merged

Speed up post-test cleanup: region-scope and gate LB scans#509
copybara-service[bot] merged 3 commits into
GoogleCloudPlatform:mainfrom
jonathanspw:region-scope-lb-cleanup

Conversation

@jonathanspw

Copy link
Copy Markdown
Contributor

Speeds up CIT's per-test cleanup phase by ~98% in typical single-region runs.

  • cleanerupper.CleanLoadBalancerResources now takes an optional regions []string parameter; when set, it iterates only those regions instead of every GCP region returned by ListRegions (~40+).
  • A new workflowRegions helper derives the relevant regions from the workflow's primary zone plus per-VM zone overrides (so suites like shapevalidation that pin VMs to europe-west4-a are still covered correctly).
  • A new opt-in TestWorkflow.CreatesLoadBalancers field gates the LB cleanup call entirely. Only loadbalancer.TestSetup sets it true; every other suite skips the call since they never create LB resources at runtime (verified by grep — only test_suites/loadbalancer/loadbalancer_test.go ever calls compute.NewForwardingRulesRESTClient, InsertBackendService, etc.).

The pre-existing failure modes (zombie VMs, networks, disks) are still covered — those cleanups are unchanged. Only the LB-resource scan is scoped/gated.

Problem

CIT's post-test cleanup is a backup for daisy's own teardown hooks. CleanLoadBalancerResources walks every GCP region listing forwarding rules, backend services, URL maps, target HTTP proxies, NEGs and health checks. Each region is ~5 list calls; ~40 regions adds up to ~200 calls per test. On a single-region test that's all wasted work, since regional resources only exist where VMs are.

Compounding that: only the loadbalancer suite actually creates LB resources. The other ~30 suites were paying for the scan to find nothing.

Changes

File Change
cleanerupper/cleanerupper.go CleanLoadBalancerResources adds regions []string param; nil = scan all (unchanged), non-empty = only those
cleanerupper/cleanerupper_test.go Existing call site updated to nil; new TestCleanLoadBalancerResourcesRegionScope asserts ListRegions is skipped and no out-of-scope region is hit when a scope is set
testworkflow.go New CreatesLoadBalancers bool on TestWorkflow; regionFromZone and workflowRegions helpers; cleanTestWorkflow derives regions and gates the LB cleanup call on the flag
testworkflow_test.go New TestWorkflowRegions (table-driven, covers mixed GA/Beta VM zones, dedup, malformed zones); new TestCleanTestWorkflowSkipsLBWhenNotMarked (asserts no LB endpoints are hit when the flag is false)
test_suites/loadbalancer/setup.go Sets t.CreatesLoadBalancers = true after the COS skip

Benchmark results

Test setup: almalinux-9-v20260501 in us-central1-a, project almalinux-image-testing-469421.

Per-test cleanup duration

Test Before (all-regions, unconditional LB) After (region-scoped + LB gated) Speedup
hostnamevalidation 3m49.3s 2.15s ~107×
imageboot 4m31.1s 3.24s ~84×
packagevalidation 3m56.4s 4.41s ~54×
ssh 3m44.8s 2.21s ~101×
loadbalancer 3m42.6s 5.55s ~40× (still does LB cleanup, but in 1 region)

Wall-clock per scenario (parallel)

Scenario Before After Savings
2 tests, -parallel_count=2 7m02s 3m17s 3m45s (~53%)
5 tests, -parallel_count=5 12m20s 9m37s 2m43s (~22%)

The 5-test wall-clock savings are smaller in proportion because the slowest test (loadbalancer at ~9 min of test execution) dominates wall clock — and that test still does the LB cleanup (correctly).

Why this matters more at low parallelism

Cleanup phases are per-test and run after each test's workflow finishes. When -parallel_count is high relative to the number of tests, cleanups overlap with other tests still running — much of the cleanup cost disappears into the wall-clock shadow of the slowest test. When parallelism is low relative to total tests, cleanups serialize and every saved second flows directly to wall clock.

Worked example with the measured ~3m45s saved per non-LB test:

Mode 40-test run before 40-test run after Wall clock saved
-parallel_count=1 (fully sequential) 40 × ~3m45s ≈ 2h30m of cleanup added on top of test time 40 × ~3s ≈ 2 min of cleanup ~2h28m
-parallel_count=5 (matches our benchmark) cleanups partially overlap; the slowest test's cleanup is on the critical path ~5s on the critical path ~3m on the critical path per "batch"
-parallel_count=40 (one slot per test) only the slowest test's cleanup blocks the run ~5s ~3m42s once

So the case that benefits the most is a developer running -parallel_count=1 to debug or run a representative subset of suites locally: the cleanup-time savings are linear in test count and fully visible. CI runs with high parallelism still save the same total API calls and project quota, but the wall-clock improvement is bounded by the slowest test on the critical path.

cleanerupper.CleanLoadBalancerResources now takes an optional regions
slice and only iterates those regions; when empty it falls back to
ListRegions (existing behavior). cleanTestWorkflow derives the regions
from the workflow's primary zone plus every per-VM zone override
(handles suites like shapevalidation that pin VMs to non-default
zones), cutting the per-region listing loop from ~40 regions to 1.

A new TestWorkflow.CreatesLoadBalancers opt-in flag gates the LB
cleanup call entirely. Only loadbalancer.TestSetup sets it true, so
other suites skip the scan since they never create LB resources at
runtime.

In CIT's typical single-region case the per-test cleanup pass drops
from ~3m47s to ~2-3s.
@google-oss-prow

Copy link
Copy Markdown

Hi @jonathanspw. Thanks for your PR.

I'm waiting for a GoogleCloudPlatform member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bkatyl

bkatyl commented May 14, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

@jonathanspw

Copy link
Copy Markdown
Contributor Author

/retest

@ChaitanyaKulkarni28

Copy link
Copy Markdown
Member

/ok-to-test

daisy can populate vm.Zone with either a short name ("us-central1-a"),
a path ("zones/us-central1-a"), or a full URL
("https://www.googleapis.com/compute/v1/projects/.../zones/us-central1-a")
depending on workflow state. The previous strings.LastIndex on the raw
input split the trailing zone suffix off a URL but left the URL prefix
intact, so workflowRegions produced strings like
"https://www.googleapis.com/.../zones/us-west1" which GCE rejected with
"Invalid value for field 'region'".

Path.Base the zone first so the same trim works for any of the three
forms. Adds a TestWorkflowRegions case that pins this behavior.
@jonathanspw

Copy link
Copy Markdown
Contributor Author

Here's a real-world impact sample:

Before (1:24):

  2026/05/18 15:08:40 Running in project almalinux-image-testing-469421 zone(s) us-central1-a. Tests will run in projects: [almalinux-image-testing-469421]
  2026/05/18 15:08:40 using -filter ^(cvm|livemigrate|suspendresume|loadbalancer|guestagent|hostnamevalidation|imageboot|licensevalidation|network|security|hotattach|packagevalidation|ssh|metadata)$
  2026/05/18 15:08:40 Add test workflow for test cvm on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:42 Add test workflow for test livemigrate on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:43 Add test workflow for test suspendresume on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:44 Add test workflow for test loadbalancer on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:44 Add test workflow for test guestagent on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:45 Add test workflow for test hostnamevalidation on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:46 Add test workflow for test imageboot on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:47 Add test workflow for test licensevalidation on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:48 Add test workflow for test network on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:49 Add test workflow for test security on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:50 Add test workflow for test hotattach on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:51 Add test workflow for test packagevalidation on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:52 Add test workflow for test ssh on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:55 Add test workflow for test metadata on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 15:08:56 Done with setup
  2026/05/18 15:08:56 Storing artifacts and logs in gs://almalinux-image-testing-469421-cloud-test-outputs/2026-05-18T15:08:56Z
  2026/05/18 15:08:56 Logs and artifacts can be found at: https://console.cloud.google.com/storage/browser/almalinux-image-testing-469421-cloud-test-outputs/2026-05-18T15:08:56Z
  2026/05/18 15:08:56 running test cvm/almalinux-10-v20260518 (ID 2h95y) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 0, delta: 14
  2026/05/18 15:19:01 finished test cvm/almalinux-10-v20260518 (ID 2h95y) in project almalinux-image-testing-469421, time spent: 10m 04s
  2026/05/18 15:19:01 cleaning up after test cvm/almalinux-10-v20260518 (ID 2h95y) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 1, delta: 13
  2026/05/18 15:20:15 running test livemigrate/almalinux-10-v20260518 (ID pxm1g) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 1, delta: 13
  2026/05/18 15:23:52 finished test livemigrate/almalinux-10-v20260518 (ID pxm1g) in project almalinux-image-testing-469421, time spent: 03m 37s
  2026/05/18 15:23:52 cleaning up after test livemigrate/almalinux-10-v20260518 (ID pxm1g) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 2, delta: 12
  2026/05/18 15:25:17 running test suspendresume/almalinux-10-v20260518 (ID j5815) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 2, delta: 12
  2026/05/18 15:28:32 finished test suspendresume/almalinux-10-v20260518 (ID j5815) in project almalinux-image-testing-469421, time spent: 03m 15s
  2026/05/18 15:28:32 cleaning up after test suspendresume/almalinux-10-v20260518 (ID j5815) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 3, delta: 11
  2026/05/18 15:29:57 running test loadbalancer/almalinux-10-v20260518 (ID nbq2n) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 3, delta: 11
  2026/05/18 15:38:41 finished test loadbalancer/almalinux-10-v20260518 (ID nbq2n) in project almalinux-image-testing-469421, time spent: 08m 44s
  2026/05/18 15:38:42 cleaning up after test loadbalancer/almalinux-10-v20260518 (ID nbq2n) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 4, delta: 10
  2026/05/18 15:39:48 running test guestagent/almalinux-10-v20260518 (ID j8786) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 4, delta: 10
  2026/05/18 15:43:35 finished test guestagent/almalinux-10-v20260518 (ID j8786) in project almalinux-image-testing-469421, time spent: 03m 47s
  2026/05/18 15:43:35 cleaning up after test guestagent/almalinux-10-v20260518 (ID j8786) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 5, delta: 9
  2026/05/18 15:44:42 running test hostnamevalidation/almalinux-10-v20260518 (ID 41vx4) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 5, delta: 9
  2026/05/18 15:48:09 finished test hostnamevalidation/almalinux-10-v20260518 (ID 41vx4) in project almalinux-image-testing-469421, time spent: 03m 27s
  2026/05/18 15:48:09 cleaning up after test hostnamevalidation/almalinux-10-v20260518 (ID 41vx4) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 6, delta: 8
  2026/05/18 15:49:24 running test imageboot/almalinux-10-v20260518 (ID w6m5m) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 6, delta: 8
  2026/05/18 15:52:43 finished test imageboot/almalinux-10-v20260518 (ID w6m5m) in project almalinux-image-testing-469421, time spent: 03m 19s
  2026/05/18 15:52:44 cleaning up after test imageboot/almalinux-10-v20260518 (ID w6m5m) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 7, delta: 7
  2026/05/18 15:53:55 running test licensevalidation/almalinux-10-v20260518 (ID j2wrq) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 7, delta: 7
  2026/05/18 15:55:50 finished test licensevalidation/almalinux-10-v20260518 (ID j2wrq) in project almalinux-image-testing-469421, time spent: 01m 54s
  2026/05/18 15:55:50 cleaning up after test licensevalidation/almalinux-10-v20260518 (ID j2wrq) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 8, delta: 6
  2026/05/18 15:56:56 running test network/almalinux-10-v20260518 (ID 3b046) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 8, delta: 6
  2026/05/18 16:06:03 finished test network/almalinux-10-v20260518 (ID 3b046) in project almalinux-image-testing-469421, time spent: 09m 06s
  2026/05/18 16:06:03 cleaning up after test network/almalinux-10-v20260518 (ID 3b046) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 9, delta: 5
  2026/05/18 16:07:16 running test security/almalinux-10-v20260518 (ID 76nl2) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 9, delta: 5
  2026/05/18 16:09:29 finished test security/almalinux-10-v20260518 (ID 76nl2) in project almalinux-image-testing-469421, time spent: 02m 12s
  2026/05/18 16:09:29 cleaning up after test security/almalinux-10-v20260518 (ID 76nl2) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 10, delta: 4
  2026/05/18 16:10:38 running test hotattach/almalinux-10-v20260518 (ID q99ys) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 10, delta: 4
  2026/05/18 16:12:54 finished test hotattach/almalinux-10-v20260518 (ID q99ys) in project almalinux-image-testing-469421, time spent: 02m 16s
  2026/05/18 16:12:54 cleaning up after test hotattach/almalinux-10-v20260518 (ID q99ys) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 11, delta: 3
  2026/05/18 16:14:06 running test packagevalidation/almalinux-10-v20260518 (ID jjxvn) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 11, delta: 3
  2026/05/18 16:16:24 finished test packagevalidation/almalinux-10-v20260518 (ID jjxvn) in project almalinux-image-testing-469421, time spent: 02m 18s
  2026/05/18 16:16:24 cleaning up after test packagevalidation/almalinux-10-v20260518 (ID jjxvn) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 12, delta: 2
  2026/05/18 16:17:44 running test ssh/almalinux-10-v20260518 (ID zxv7j) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 12, delta: 2
  2026/05/18 16:25:50 finished test ssh/almalinux-10-v20260518 (ID zxv7j) in project almalinux-image-testing-469421, time spent: 08m 05s
  2026/05/18 16:25:50 cleaning up after test ssh/almalinux-10-v20260518 (ID zxv7j) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 13, delta: 1
  2026/05/18 16:27:02 running test metadata/almalinux-10-v20260518 (ID w4700) in project: almalinux-image-testing-469421, zone: us-central1-a, progress: total: 14, running: 1, finished: 13, delta: 1
  2026/05/18 16:32:00 finished test metadata/almalinux-10-v20260518 (ID w4700) in project almalinux-image-testing-469421, time spent: 04m 58s
  2026/05/18 16:32:01 cleaning up after test metadata/almalinux-10-v20260518 (ID w4700) in project almalinux-image-testing-469421, progress: total: 14, running: 0, finished: 14, delta: 0

After (0:52):

  2026/05/18 21:27:05 Running in project almalinux-image-testing-469421 zone(s) europe-west4-a. Tests will run in projects: [almalinux-image-testing-469421]
  2026/05/18 21:27:05 using -filter ^(cvm|livemigrate|suspendresume|loadbalancer|guestagent|hostnamevalidation|imageboot|licensevalidation|security|hotattach|packagevalidation|ssh|metadata)$
  2026/05/18 21:27:05 Add test workflow for test cvm on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:06 Add test workflow for test livemigrate on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:07 Add test workflow for test suspendresume on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:08 Add test workflow for test loadbalancer on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:09 Add test workflow for test guestagent on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:10 Add test workflow for test hostnamevalidation on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:11 Add test workflow for test imageboot on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:12 Add test workflow for test licensevalidation on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:13 Add test workflow for test security on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:14 Add test workflow for test hotattach on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:15 Add test workflow for test packagevalidation on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:16 Add test workflow for test ssh on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:19 Add test workflow for test metadata on image projects/almalinux-dev-images-469421/global/images/family/almalinux-10
  2026/05/18 21:27:20 Done with setup
  2026/05/18 21:27:21 Storing artifacts and logs in gs://almalinux-image-testing-469421-cloud-test-outputs/2026-05-18T21:27:21Z
  2026/05/18 21:27:21 Logs and artifacts can be found at: https://console.cloud.google.com/storage/browser/almalinux-image-testing-469421-cloud-test-outputs/2026-05-18T21:27:21Z
  2026/05/18 21:27:21 running test cvm/almalinux-10-v20260518 (ID h85tp) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 0, delta: 13
  2026/05/18 21:35:11 finished test cvm/almalinux-10-v20260518 (ID h85tp) in project almalinux-image-testing-469421, time spent: 07m 50s
  2026/05/18 21:35:11 cleaning up after test cvm/almalinux-10-v20260518 (ID h85tp) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 1, delta: 12
  2026/05/18 21:35:13 running test livemigrate/almalinux-10-v20260518 (ID wyvhh) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 1, delta: 12
  2026/05/18 21:39:19 finished test livemigrate/almalinux-10-v20260518 (ID wyvhh) in project almalinux-image-testing-469421, time spent: 04m 06s
  2026/05/18 21:39:20 cleaning up after test livemigrate/almalinux-10-v20260518 (ID wyvhh) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 2, delta: 11
  2026/05/18 21:39:23 running test suspendresume/almalinux-10-v20260518 (ID 2q7by) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 2, delta: 11
  2026/05/18 21:42:21 finished test suspendresume/almalinux-10-v20260518 (ID 2q7by) in project almalinux-image-testing-469421, time spent: 02m 58s
  2026/05/18 21:42:21 cleaning up after test suspendresume/almalinux-10-v20260518 (ID 2q7by) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 3, delta: 10
  2026/05/18 21:42:23 running test loadbalancer/almalinux-10-v20260518 (ID bm587) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 3, delta: 10
  2026/05/18 21:48:55 finished test loadbalancer/almalinux-10-v20260518 (ID bm587) in project almalinux-image-testing-469421, time spent: 06m 31s
  2026/05/18 21:48:55 cleaning up after test loadbalancer/almalinux-10-v20260518 (ID bm587) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 4, delta: 9
  2026/05/18 21:48:59 running test guestagent/almalinux-10-v20260518 (ID h965t) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 4, delta: 9
  2026/05/18 21:52:56 finished test guestagent/almalinux-10-v20260518 (ID h965t) in project almalinux-image-testing-469421, time spent: 03m 57s
  2026/05/18 21:52:56 cleaning up after test guestagent/almalinux-10-v20260518 (ID h965t) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 5, delta: 8
  2026/05/18 21:52:58 running test hostnamevalidation/almalinux-10-v20260518 (ID pxwmj) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 5, delta: 8
  2026/05/18 21:55:08 finished test hostnamevalidation/almalinux-10-v20260518 (ID pxwmj) in project almalinux-image-testing-469421, time spent: 02m 09s
  2026/05/18 21:55:09 cleaning up after test hostnamevalidation/almalinux-10-v20260518 (ID pxwmj) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 6, delta: 7
  2026/05/18 21:55:11 running test imageboot/almalinux-10-v20260518 (ID qjbsl) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 6, delta: 7
  2026/05/18 21:58:26 finished test imageboot/almalinux-10-v20260518 (ID qjbsl) in project almalinux-image-testing-469421, time spent: 03m 14s
  2026/05/18 21:58:26 cleaning up after test imageboot/almalinux-10-v20260518 (ID qjbsl) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 7, delta: 6
  2026/05/18 21:58:28 running test licensevalidation/almalinux-10-v20260518 (ID xh2hv) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 7, delta: 6
  2026/05/18 22:00:24 finished test licensevalidation/almalinux-10-v20260518 (ID xh2hv) in project almalinux-image-testing-469421, time spent: 01m 55s
  2026/05/18 22:00:24 cleaning up after test licensevalidation/almalinux-10-v20260518 (ID xh2hv) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 8, delta: 5
  2026/05/18 22:00:26 running test security/almalinux-10-v20260518 (ID v04tx) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 8, delta: 5
  2026/05/18 22:02:40 finished test security/almalinux-10-v20260518 (ID v04tx) in project almalinux-image-testing-469421, time spent: 02m 13s
  2026/05/18 22:02:40 cleaning up after test security/almalinux-10-v20260518 (ID v04tx) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 9, delta: 4
  2026/05/18 22:02:42 running test hotattach/almalinux-10-v20260518 (ID 060x8) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 9, delta: 4
  2026/05/18 22:04:46 finished test hotattach/almalinux-10-v20260518 (ID 060x8) in project almalinux-image-testing-469421, time spent: 02m 03s
  2026/05/18 22:04:46 cleaning up after test hotattach/almalinux-10-v20260518 (ID 060x8) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 10, delta: 3
  2026/05/18 22:04:48 running test packagevalidation/almalinux-10-v20260518 (ID 64xt6) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 10, delta: 3
  2026/05/18 22:06:52 finished test packagevalidation/almalinux-10-v20260518 (ID 64xt6) in project almalinux-image-testing-469421, time spent: 02m 03s
  2026/05/18 22:06:52 cleaning up after test packagevalidation/almalinux-10-v20260518 (ID 64xt6) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 11, delta: 2
  2026/05/18 22:06:54 running test ssh/almalinux-10-v20260518 (ID wtm64) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 11, delta: 2
  2026/05/18 22:14:53 finished test ssh/almalinux-10-v20260518 (ID wtm64) in project almalinux-image-testing-469421, time spent: 07m 59s
  2026/05/18 22:14:53 cleaning up after test ssh/almalinux-10-v20260518 (ID wtm64) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 12, delta: 1
  2026/05/18 22:14:55 running test metadata/almalinux-10-v20260518 (ID 32y08) in project: almalinux-image-testing-469421, zone: europe-west4-a, progress: total: 13, running: 1, finished: 12, delta: 1
  2026/05/18 22:19:18 finished test metadata/almalinux-10-v20260518 (ID 32y08) in project almalinux-image-testing-469421, time spent: 04m 22s
  2026/05/18 22:19:19 cleaning up after test metadata/almalinux-10-v20260518 (ID 32y08) in project almalinux-image-testing-469421, progress: total: 13, running: 0, finished: 13, delta: 0

copybara-service Bot pushed a commit that referenced this pull request Jun 4, 2026
--
d894462 by Jonathan Wright <jonathan@almalinux.org>:

Speed up post-test cleanup: region-scope and gate LB scans

cleanerupper.CleanLoadBalancerResources now takes an optional regions
slice and only iterates those regions; when empty it falls back to
ListRegions (existing behavior). cleanTestWorkflow derives the regions
from the workflow's primary zone plus every per-VM zone override
(handles suites like shapevalidation that pin VMs to non-default
zones), cutting the per-region listing loop from ~40 regions to 1.

A new TestWorkflow.CreatesLoadBalancers opt-in flag gates the LB
cleanup call entirely. Only loadbalancer.TestSetup sets it true, so
other suites skip the scan since they never create LB resources at
runtime.

In CIT's typical single-region case the per-test cleanup pass drops
from ~3m47s to ~2-3s.

--
f1b669a by Jonathan Wright <jonathan@almalinux.org>:

gofmt: realign TestWorkflowRegions testcases struct

--
9bacfae by Jonathan Wright <jonathan@almalinux.org>:

Fix regionFromZone to handle URL- and path-form zones

daisy can populate vm.Zone with either a short name ("us-central1-a"),
a path ("zones/us-central1-a"), or a full URL
("https://www.googleapis.com/compute/v1/projects/.../zones/us-central1-a")
depending on workflow state. The previous strings.LastIndex on the raw
input split the trailing zone suffix off a URL but left the URL prefix
intact, so workflowRegions produced strings like
"https://www.googleapis.com/.../zones/us-west1" which GCE rejected with
"Invalid value for field 'region'".

Path.Base the zone first so the same trim works for any of the three
forms. Adds a TestWorkflowRegions case that pins this behavior.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#509 from jonathanspw:region-scope-lb-cleanup 9bacfae
PiperOrigin-RevId: 926845123
copybara-service Bot pushed a commit that referenced this pull request Jun 4, 2026
--
d894462 by Jonathan Wright <jonathan@almalinux.org>:

Speed up post-test cleanup: region-scope and gate LB scans

cleanerupper.CleanLoadBalancerResources now takes an optional regions
slice and only iterates those regions; when empty it falls back to
ListRegions (existing behavior). cleanTestWorkflow derives the regions
from the workflow's primary zone plus every per-VM zone override
(handles suites like shapevalidation that pin VMs to non-default
zones), cutting the per-region listing loop from ~40 regions to 1.

A new TestWorkflow.CreatesLoadBalancers opt-in flag gates the LB
cleanup call entirely. Only loadbalancer.TestSetup sets it true, so
other suites skip the scan since they never create LB resources at
runtime.

In CIT's typical single-region case the per-test cleanup pass drops
from ~3m47s to ~2-3s.

--
f1b669a by Jonathan Wright <jonathan@almalinux.org>:

gofmt: realign TestWorkflowRegions testcases struct

--
9bacfae by Jonathan Wright <jonathan@almalinux.org>:

Fix regionFromZone to handle URL- and path-form zones

daisy can populate vm.Zone with either a short name ("us-central1-a"),
a path ("zones/us-central1-a"), or a full URL
("https://www.googleapis.com/compute/v1/projects/.../zones/us-central1-a")
depending on workflow state. The previous strings.LastIndex on the raw
input split the trailing zone suffix off a URL but left the URL prefix
intact, so workflowRegions produced strings like
"https://www.googleapis.com/.../zones/us-west1" which GCE rejected with
"Invalid value for field 'region'".

Path.Base the zone first so the same trim works for any of the three
forms. Adds a TestWorkflowRegions case that pins this behavior.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#509 from jonathanspw:region-scope-lb-cleanup 9bacfae
PiperOrigin-RevId: 926845123
@copybara-service copybara-service Bot merged commit e72f2bf into GoogleCloudPlatform:main Jun 5, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants