From a7491753d77f87ea22a997f69af94c7934e4398f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 01:09:51 +0000 Subject: [PATCH] ci(mcpx): give the stress go test runs an explicit timeout (#10489) -count=3 runs every pass of a package inside one test binary, and one internal/e2e pass alone is over five minutes of real-time waits, so go test's default 10m timeout cannot hold the e2e package's three passes under -race. Pass -timeout 25m to the PR e2e stress run and -timeout 50m to the nightly, each under its job's own limit, so a real hang still panics with goroutine dumps rather than being killed by the runner. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/mcpx.yml | 16 +++++++++++++--- pkgs/mcpx/docs/testing.md | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mcpx.yml b/.github/workflows/mcpx.yml index f1cd12fd0d..c68dc4feb6 100644 --- a/.github/workflows/mcpx.yml +++ b/.github/workflows/mcpx.yml @@ -570,8 +570,13 @@ jobs: fi if [ -n "$e2e" ]; then echo "e2e package (-count=3): $e2e" + # One e2e pass is about five minutes of real-time waits, and + # -count=3 runs every pass inside one test binary, so go + # test's default 10m timeout cannot hold it (#10489). The + # explicit timeout sits under the job's 30m, so a hang still + # panics with goroutine dumps instead of a runner kill. # shellcheck disable=SC2086 - go test $e2e -race -shuffle=$seed -count=3 + go test $e2e -race -shuffle=$seed -count=3 -timeout 25m fi - name: Upload runtime feature coverage ledger @@ -632,8 +637,13 @@ jobs: seed=$(python3 -c 'import hashlib, os; root = hashlib.sha256(b"mcpx-test-seed/v1\x00" + os.environ["MCPX_TEST_SEED"].encode()).digest(); print(int.from_bytes(hashlib.sha256(root + b"shuffle").digest()[:8], "big") & (2**63 - 1))') echo "SHUFFLE_SEED=$seed" >> "$GITHUB_ENV" echo "shuffle seed: $seed (run seed: $MCPX_TEST_SEED; reproduce with: MCPX_TEST_SEED=$MCPX_TEST_SEED pkgs/mcpx/scripts/test.sh ./... -race -count=3)" + # -timeout: the e2e package's three passes run in one test + # binary and take well over go test's default 10m under + # -race (#10489). 50m stays under the job's 60m, so a real + # hang still panics with goroutine dumps before the runner + # kills the job. # shellcheck disable=SC2086 - go test ./... -race -shuffle=$seed -count=3 + go test ./... -race -shuffle=$seed -count=3 -timeout 50m - name: Open or update the nightly failure issue if: failure() && github.event_name == 'schedule' @@ -644,7 +654,7 @@ jobs: body="The nightly flake-policy stress run failed on ${{ matrix.os }} (shuffle seed: $SHUFFLE_SEED). Run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID - Reproduce: \`go test ./... -race -shuffle=$SHUFFLE_SEED -count=3\` in pkgs/mcpx. + Reproduce: \`go test ./... -race -shuffle=$SHUFFLE_SEED -count=3 -timeout 50m\` in pkgs/mcpx. Policy: #1973 — fix the flake; quarantine only via testsupport.Quarantine with an issue link and an expiry." existing=$(gh issue list --repo "$GITHUB_REPOSITORY" --search "$title in:title" --state open --json number --jq '.[0].number // empty') diff --git a/pkgs/mcpx/docs/testing.md b/pkgs/mcpx/docs/testing.md index 241bf00ee6..97da936136 100644 --- a/pkgs/mcpx/docs/testing.md +++ b/pkgs/mcpx/docs/testing.md @@ -98,6 +98,12 @@ off the critical path, never by retrying a failure away: `-race -shuffle= -count=3` on `ubuntu-latest` **and** `macos-latest`. On failure it opens or updates the single "mcpx nightly stress failure" issue; it never blocks a PR. +- **Explicit timeouts.** `-count=3` runs every pass of a package inside one + test binary, and one `internal/e2e` pass is about five minutes of + real-time waits, so go test's default 10m timeout cannot hold it (#10489). + The e2e stress run passes `-timeout 25m` and the nightly passes + `-timeout 50m`, each under its job's own limit, so a real hang still + panics with goroutine dumps instead of being killed by the runner. - **Fix first.** A flake the stress jobs surface is a bug: fix it. Only when a fix genuinely cannot land yet, quarantine the test with `testsupport.Quarantine(t, "", "YYYY-MM-DD")` from