Problem
time.Sleep in tests is a flake source. The shared-anvil pattern already avoids it for the main flow, but there may be stragglers (especially around concurrency and mempool waits).
Proposal
git grep 'time\.Sleep' -- '*_test.go' and audit each hit.
- Replace each with one of:
WaitForBlock / WaitForMemPoolEmpty (poll loops with a deadline)
- A
t.Context()-aware select on a channel
require.Eventually (testify) for "X is true within Y"
- Where a small delay is actually needed (e.g. between two impersonate calls), document why with a comment.
Acceptance criteria
git grep 'time\.Sleep' -- '*_test.go' is empty, or every remaining hit has a // reason: comment.
go test -race -count=10 ./... passes (10× catches flakes).
Problem
time.Sleepin tests is a flake source. The shared-anvil pattern already avoids it for the main flow, but there may be stragglers (especially around concurrency and mempool waits).Proposal
git grep 'time\.Sleep' -- '*_test.go'and audit each hit.WaitForBlock/WaitForMemPoolEmpty(poll loops with a deadline)t.Context()-aware select on a channelrequire.Eventually(testify) for "X is true within Y"Acceptance criteria
git grep 'time\.Sleep' -- '*_test.go'is empty, or every remaining hit has a// reason:comment.go test -race -count=10 ./...passes (10× catches flakes).