Skip to content

Commit db8c44c

Browse files
committed
addressed comments
1 parent a881ccd commit db8c44c

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

dev/ci/periodics/_create_project_and_run_e2e

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ EXIT_CODE=0
3232
dev/tasks/create-test-project
3333
trap dev/tasks/cleanup-test-resources EXIT
3434

35-
TEST_TIMEOUT=240m dev/tasks/run-e2e || EXIT_CODE=$?
35+
# If there doesn't exist a TEST_TIMEOUT from the service, keep it 240m
36+
if [[ -z "${TEST_TIMEOUT:-}" ]]; then
37+
TEST_TIMEOUT=240m
38+
fi
39+
echo "Using TEST_TIMEOUT=${TEST_TIMEOUT}"
40+
41+
dev/tasks/run-e2e || EXIT_CODE=$?
3642

3743
if [[ -n "${ARTIFACTS:-}" ]]; then
3844
# Capture our source tree, which includes golden output

dev/ci/periodics/e2e-service-storage

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ REPO_ROOT="$(git rev-parse --show-toplevel)"
2121
cd "${REPO_ROOT}"
2222

2323
export ONLY_TEST_APIGROUPS=storage.cnrm.cloud.google.com
24+
export SUBTEST_TIMEOUT_E2E=280m
25+
export TEST_TIMEOUT = 280M
2426

2527
dev/ci/periodics/_create_project_and_run_e2e

tests/e2e/unified_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,15 @@ func isOperationDone(s string) bool {
611611
// addTestTimeout will ensure the test fails if not completed before timeout
612612
func addTestTimeout(ctx context.Context, t *testing.T, timeout time.Duration, name string) context.Context {
613613

614-
if name == "storageanywherecache" || name == "storageanywherecache-base" || name == "storageanywherecache-full" {
615-
// Special timeouts for anywherecache resource when target is real
616-
if targetGCP := os.Getenv("E2E_GCP_TARGET"); targetGCP == "real" {
617-
timeout = 4 * time.Hour
614+
if targetGCP := os.Getenv("E2E_GCP_TARGET"); targetGCP == "real" {
615+
// If the target is real, check if SUBTEST_TIMEOUT_E2E is present set
616+
// accordingly, or fallback to original timeouts if there's any error.
617+
618+
if subtestTimeoutE2EStr := os.Getenv("SUBTEST_TIMEOUT_E2E"); subtestTimeoutE2EStr != "" {
619+
parsedTimeout, err := time.ParseDuration(subtestTimeoutE2EStr)
620+
if err == nil {
621+
timeout = parsedTimeout
622+
}
618623
}
619624
}
620625

0 commit comments

Comments
 (0)