Skip to content

Commit d08d495

Browse files
ReneWerner87claude
andcommitted
ci(test): stabilize v2 tests; move -race to a separate non-blocking job
The v2 test matrix has been red on newer Go versions and non-Linux platforms. The suite has several pre-existing flaky data races (e.g. the package-global fiber.Get client in Test_Client_UserAgent) and order- dependent tests. Two things made this unfixable by CI config alone: - A -race detector abort (os.Exit) fails the whole run, and neither the old nick-fields/retry (retries the whole run) nor gotestsum's per-test rerun-fails can mask it. - gotestsum's rerun-fails is additionally defeated here because the recover test prints a literal "panic:" (via debug.Stack), which gotestsum treats as a suspected panic and then refuses to rerun any failed test. So keep the whole-suite retry for the blocking job and take -race out of the gate instead: - Blocking Build job runs `go test ./... -count=1` (no -race, no -shuffle; -shuffle exposes the order-dependent tests) under nick-fields/retry, which has no panic heuristic to trip over. - Add a separate non-blocking Race job (continue-on-error) that runs `go test -race -shuffle=on` so the pre-existing races stay visible without blocking merges. Fold -race back into Build once the races are fixed (#4496 fixes the first one). - Raise the matrix floor to Go 1.20 to match the module's go.mod (go 1.20). - Exclude Go <= 1.21 on macos-latest: those binaries abort on the arm64 runner's newer dyld with "missing LC_UUID load command" (Go 1.22+ emits LC_UUID). Old Go stays covered on ubuntu and windows. - Add fail-fast: false and explicit job timeouts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0c8cc20 commit d08d495

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@ name: Test
1616
jobs:
1717
Build:
1818
strategy:
19+
fail-fast: false
1920
matrix:
20-
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x]
21+
# Floor is 1.20 to match the module's go.mod (go 1.20).
22+
go-version: [1.20.x, 1.21.x, 1.22.x, 1.23.x]
2123
platform: [ubuntu-latest, windows-latest, macos-latest]
24+
exclude:
25+
# Go <= 1.21 test binaries abort on macos-latest (arm64) with
26+
# "dyld: missing LC_UUID load command"; Go 1.22+ emits LC_UUID.
27+
# Old Go stays covered on ubuntu and windows.
28+
- { go-version: 1.20.x, platform: macos-latest }
29+
- { go-version: 1.21.x, platform: macos-latest }
2230
runs-on: ${{ matrix.platform }}
31+
timeout-minutes: 20
2332
steps:
2433
- name: Fetch Repository
2534
uses: actions/checkout@v4
@@ -29,9 +38,34 @@ jobs:
2938
with:
3039
go-version: ${{ matrix.go-version }}
3140

41+
# Whole-suite retry, without -race and without -shuffle in the blocking
42+
# job: the suite has pre-existing data races (whose -race abort fails the
43+
# run) and order-dependent tests (which -shuffle exposes). gotestsum's
44+
# per-test rerun cannot absorb these because the recover test prints a
45+
# literal "panic:" (via debug.Stack), which makes gotestsum treat the
46+
# whole run as a suspected panic and refuse to rerun. Race detection runs
47+
# in the separate non-blocking Race job below.
3248
- name: Run Test
3349
uses: nick-fields/retry@v2
3450
with:
3551
max_attempts: 3
3652
timeout_minutes: 15
37-
command: go test ./... -v -race -count=1
53+
command: go test ./... -count=1
54+
55+
# Non-blocking: surfaces the suite's pre-existing data races without gating
56+
# merges on them. Fix the races over time, then fold -race into Build.
57+
Race:
58+
runs-on: ubuntu-latest
59+
continue-on-error: true
60+
timeout-minutes: 20
61+
steps:
62+
- name: Fetch Repository
63+
uses: actions/checkout@v4
64+
65+
- name: Install Go
66+
uses: actions/setup-go@v6
67+
with:
68+
go-version: 1.23.x
69+
70+
- name: Test (race)
71+
run: go test ./... -race -count=1 -shuffle=on

0 commit comments

Comments
 (0)