Copybara import of the project:#522
Merged
Merged
Conversation
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.
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.
8cfe641 to
8f1cc13
Compare
PiperOrigin-RevId: 926971335
8f1cc13 to
e72f2bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copybara import of the project:
--
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