Skip to content

[v0.2.0] Run go test with -shuffle=on in CI #74

Description

@neverDefined

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ciGitHub Actions, release automationarea:testsTest coverage, benchmarks, error pathstype:choreHousekeeping, no user-visible change

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions