Skip to content

Commit 718a790

Browse files
authored
fix: skip gpu e2e tests on sku quota exceeded and add configurable test timeout (#7836)
1 parent 2930145 commit 718a790

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

.pipelines/e2e-gpu.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ variables:
33
TAGS_TO_RUN: "gpu=true"
44
TAGS_TO_SKIP: "os=windows"
55
SKIP_E2E_TESTS: false
6+
SKIP_TESTS_WITH_SKU_CAPACITY_ISSUE: true
7+
E2E_GO_TEST_TIMEOUT: "75m"
68
trigger:
79
branches:
810
include:

.pipelines/scripts/e2e_run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ LOGGING_DIR="${LOGGING_DIR:-}"
3737
E2E_SUBSCRIPTION_ID="${E2E_SUBSCRIPTION_ID:-}"
3838
TAGS_TO_SKIP="${TAGS_TO_SKIP:-}"
3939
TAGS_TO_RUN="${TAGS_TO_RUN:-}"
40+
E2E_GO_TEST_TIMEOUT="${E2E_GO_TEST_TIMEOUT:-90m}"
4041
GALLERY_NAME="${GALLERY_NAME:-}"
4142
SIG_GALLERY_NAME="${SIG_GALLERY_NAME:-}"
4243

@@ -49,6 +50,7 @@ echo "TAGS_TO_SKIP: ${TAGS_TO_SKIP}"
4950
echo "TAGS_TO_RUN: ${TAGS_TO_RUN}"
5051
echo "GALLERY_NAME: ${GALLERY_NAME}"
5152
echo "SIG_GALLERY_NAME: ${SIG_GALLERY_NAME}"
53+
echo "E2E_GO_TEST_TIMEOUT: ${E2E_GO_TEST_TIMEOUT}"
5254

5355
# set variables that the go program expects if we are running a specific build
5456
if [ -n "${VHD_BUILD_ID}" ]; then
@@ -94,7 +96,7 @@ rm -f "$temp_file"
9496
# gotestsum configure to only show logs for failed tests, json file for detailed logs
9597
# Run the tests! Yey!
9698
test_exit_code=0
97-
./bin/gotestsum --format testdox --junitfile "${BUILD_SRC_DIR}/e2e/report.xml" --jsonfile "${BUILD_SRC_DIR}/e2e/test-log.json" -- -parallel 150 -timeout 90m || test_exit_code=$?
99+
./bin/gotestsum --format testdox --junitfile "${BUILD_SRC_DIR}/e2e/report.xml" --jsonfile "${BUILD_SRC_DIR}/e2e/test-log.json" -- -parallel 150 -timeout "${E2E_GO_TEST_TIMEOUT}" || test_exit_code=$?
98100

99101
# Upload test results as Azure DevOps artifacts
100102
echo "##vso[artifact.upload containerfolder=test-results;artifactname=e2e-test-log]${BUILD_SRC_DIR}/e2e/test-log.json"

e2e/vmss.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,23 @@ func getPrivateIPFromVMSSVM(ctx context.Context, resourceGroup, vmssName, instan
439439
}
440440

441441
func skipTestIfSKUNotAvailableErr(t testing.TB, err error) {
442-
// sometimes the SKU is not available and we can't do anything. Skip the test in this case.
442+
if !config.Config.SkipTestsWithSKUCapacityIssue {
443+
return
444+
}
443445
var respErr *azcore.ResponseError
444-
if config.Config.SkipTestsWithSKUCapacityIssue &&
445-
errors.As(err, &respErr) &&
446-
respErr.StatusCode == 409 &&
447-
respErr.ErrorCode == "SkuNotAvailable" {
446+
if !errors.As(err, &respErr) || respErr.StatusCode != 409 {
447+
return
448+
}
449+
// sometimes the SKU is not available and we can't do anything. Skip the test in this case.
450+
if respErr.ErrorCode == "SkuNotAvailable" {
448451
t.Skip("skipping scenario SKU not available", t.Name(), err)
449452
}
453+
// sometimes the SKU quota is exceeded and we can't do anything. Skip the test in this case.
454+
if respErr.ErrorCode == "OperationNotAllowed" &&
455+
strings.Contains(respErr.Error(), "exceeding approved") &&
456+
strings.Contains(respErr.Error(), "quota") {
457+
t.Skip("skipping scenario SKU quota exceeded", t.Name(), err)
458+
}
450459
}
451460

452461
func cleanupVMSS(ctx context.Context, s *Scenario, vm *ScenarioVM) {

0 commit comments

Comments
 (0)