Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions e2e/vmss.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,19 +510,31 @@ func skipTestIfSKUNotAvailableErr(t testing.TB, err error) {
return
}
var respErr *azcore.ResponseError
if !errors.As(err, &respErr) || respErr.StatusCode != 409 {
if !errors.As(err, &respErr) {
return
}
// sometimes the SKU is not available and we can't do anything. Skip the test in this case.
// SKU not available in region (409)
if respErr.ErrorCode == "SkuNotAvailable" {
t.Skip("skipping scenario SKU not available", t.Name(), err)
}
// sometimes the SKU quota is exceeded and we can't do anything. Skip the test in this case.
// Quota exceeded (409)
Comment on lines +516 to +520
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments mention “(409)” but the function no longer checks respErr.StatusCode. Either reintroduce status-code checks for these specific cases or adjust the comments so they don’t assert a status code the code isn’t enforcing.

Copilot uses AI. Check for mistakes.
if respErr.ErrorCode == "OperationNotAllowed" &&
strings.Contains(respErr.Error(), "exceeding approved") &&
strings.Contains(respErr.Error(), "quota") {
t.Skip("skipping scenario SKU quota exceeded", t.Name(), err)
}
// Allocation failures for GPU/exotic SKUs with limited availability.
// AllocationFailed returns HTTP 200 (not 409), so it won't be caught by status code checks.
// These can persist even after CreateVMSSWithRetry exhausts its retries.
if respErr.ErrorCode == "AllocationFailed" {
t.Skip("skipping scenario allocation failed", t.Name(), err)
}
// Zonal allocation constraints — no capacity in the requested zone (409)
if respErr.ErrorCode == "OverconstrainedZonalAllocationRequest" ||
respErr.ErrorCode == "OverconstrainedAllocationRequest" ||
respErr.ErrorCode == "ZonalAllocationFailed" {
t.Skip("skipping scenario zonal allocation constrained", t.Name(), err)
Comment on lines +532 to +536
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment states the zonal allocation constraint errors are “(409)”, but the logic now skips solely by ErrorCode without validating status. Update the comment (or add a status-code guard) to keep documentation consistent with behavior.

Copilot uses AI. Check for mistakes.
}
}

func cleanupVMSS(ctx context.Context, s *Scenario, vm *ScenarioVM) {
Expand Down
Loading