Seven tests in components/offload fail on origin/main at -count=2 and pass at -count=1:
TestGatePermitsHighReuseContent
TestBreakEvenSizesMatchTheDocumentedVerdict
- and five more in the same file
The cause is global state in extract_econ leaking between runs. A review reproduced it independently on origin/main, so it is not a regression from any open branch.
Why it is worth its own issue rather than a note
It makes a claim several PRs have made unfalsifiable. "go test -race ./... is clean" is a normal line in a PR description here, and it is true — at -count=1, which is the default. A test that only passes on a fresh process is a test that has not been shown to be independent of the ones before it, and this package's tests are exactly where the economics of an expensive component are pinned. A leak that changes a gate's verdict between runs could equally change it between an ordering the CI happens to use and one a developer happens to use.
-count=2 is also the cheapest available check for this class of defect: it needs no new infrastructure, and it is how the leak was found.
Suggested shape
- Find the package-level state.
extract_econ's pricing/aggressiveness tables are the named suspect; confirm rather than assume, because a second leaking variable would be masked by fixing the first.
- Reset it per test, or make it an instance field. Instance is better where it is reachable — a reset hook is another thing to remember.
- Add
-count=2 to the test target, or at least to CI, so the property is checked rather than known. Without that step this recurs the next time a table is hoisted for convenience.
Not attributable to any branch
Reproduced on origin/main at e66f255. Per the repo rule for a defect in main unrelated to the change under test: its own issue, its own worktree branched from origin/main, its own PR — a fix riding a long-lived feature branch cannot ship until that branch merges.
Found by the review on #234, which ran the suite at -count=2 and then checked main before attributing it.
Seven tests in
components/offloadfail onorigin/mainat-count=2and pass at-count=1:TestGatePermitsHighReuseContentTestBreakEvenSizesMatchTheDocumentedVerdictThe cause is global state in
extract_econleaking between runs. A review reproduced it independently onorigin/main, so it is not a regression from any open branch.Why it is worth its own issue rather than a note
It makes a claim several PRs have made unfalsifiable. "
go test -race ./...is clean" is a normal line in a PR description here, and it is true — at-count=1, which is the default. A test that only passes on a fresh process is a test that has not been shown to be independent of the ones before it, and this package's tests are exactly where the economics of an expensive component are pinned. A leak that changes a gate's verdict between runs could equally change it between an ordering the CI happens to use and one a developer happens to use.-count=2is also the cheapest available check for this class of defect: it needs no new infrastructure, and it is how the leak was found.Suggested shape
extract_econ's pricing/aggressiveness tables are the named suspect; confirm rather than assume, because a second leaking variable would be masked by fixing the first.-count=2to the test target, or at least to CI, so the property is checked rather than known. Without that step this recurs the next time a table is hoisted for convenience.Not attributable to any branch
Reproduced on
origin/mainate66f255. Per the repo rule for a defect inmainunrelated to the change under test: its own issue, its own worktree branched fromorigin/main, its own PR — a fix riding a long-lived feature branch cannot ship until that branch merges.Found by the review on #234, which ran the suite at
-count=2and then checkedmainbefore attributing it.