Skip to content

testquality: a test that sleeps a second or more is flagged - #66

Closed
aledbf wants to merge 2 commits into
mainfrom
testquality/waits
Closed

aledbf wants to merge 2 commits into
mainfrom
testquality/waits

Conversation

@aledbf

@aledbf aledbf commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

The second half of the flake work after spin's tally (go-tools#65 is the first): a time.Sleep of a constant second or more in a test's body, closures included, is reported as TestX sleeps 5s for nothing it can see. Under a second paces a loop and is not flagged; a computed duration is not a number to judge; a helper's sleep is the helper's, one line to fix however many tests call it. The allowlist ratchet is the existing one (-allow, keyed package:Test), so the sleeps whose only signal is the clock are carried with their why.

On spin it finds 42 tests today (12 in internal/runner/vmm's integration lane, 5 in volumes', 17 in internal/e2e); spin's PR adds them to its allowlist with each sleep's own reason, and the list only shrinks from there.

Fixture waits: a second, a subtest's and a goroutine's sleep, time.Minute + 500ms, and what is not flagged (under a second, a variable, a helper, another type's Sleep, time.After). Docs and README updated. Lint, test, mutate 0 survivors, site.

🤖 Generated with Claude Code

aledbf and others added 2 commits October 25, 2026 15:18
A wait on the clock passes on a quiet machine and fails on a loaded one,
which is what a flake is: of 45 failed fleet gates in two days of spin,
the real flakes were each a bound the machine's load outran. A
time.Sleep of a constant second or more in a test's body - a subtest's
or a goroutine's included - is reported with its length; under a second
paces a loop, a computed duration is not a number to judge, and a
helper's sleep is the helper's. The allowlist carries the ones whose only
signal is the clock, each with its why.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the clock

Nine of spin's 43 were a loop's pacing: for deadline...; time.Sleep(2s).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@aledbf

aledbf commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Replaced by the same commits at main's head (#68).

@aledbf aledbf closed this Oct 25, 2026
@aledbf
aledbf deleted the testquality/waits branch October 25, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant