Problem
The shared-anvil test pattern reuses one *Anvil instance across subtests, with ResetState between them. If a subtest accidentally relies on state set up by a previous one (instead of constructing its own), the tests pass in declaration order but break under reordering.
go test -shuffle=on runs tests in randomized order. Catching that drift is cheap and worth it.
Proposal
In .github/workflows/ci.yml, add -shuffle=on to the go test invocation:
- run: go test -race ./...
+ run: go test -race -shuffle=on ./...
Failures will print the seed; we can add -shuffle=<seed> to reproduce locally.
Acceptance criteria
- CI runs
-shuffle=on.
- All tests pass with shuffling for at least 5 consecutive runs (i.e. the seed is properly random and we don't have hidden ordering deps).
- README "Testing" section mentions the seed-reproduction trick.
Problem
The shared-anvil test pattern reuses one
*Anvilinstance across subtests, withResetStatebetween them. If a subtest accidentally relies on state set up by a previous one (instead of constructing its own), the tests pass in declaration order but break under reordering.go test -shuffle=onruns tests in randomized order. Catching that drift is cheap and worth it.Proposal
In
.github/workflows/ci.yml, add-shuffle=onto thego testinvocation:Failures will print the seed; we can add
-shuffle=<seed>to reproduce locally.Acceptance criteria
-shuffle=on.