You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reach_rank tests: onDegreeSnapshotLoad written while a previous test's singleflight refresh still reads it (-race flake) #224
cd cmd/server && go test -race ./... can fail in TestReachRank_RefreshHonoursBackoffAfterQueuedFailure with "race detected during execution of test". This was found during the #222 review, which does not touch these files.
The test writes the package variable onDegreeSnapshotLoad (reach_rank_test.go ~969).
Meanwhile, a singleflight refresh goroutine left over from the previous test, TestReachRank_ExpiredSnapshotAlwaysRefreshes, reads it (reach_rank.go ~311).
TestReachRank_ExpiredSnapshotAlwaysRefreshes now ends with awaitDegreeRefresh, which joins the "degree" singleflight key once more. A late refresh that a caller registered therefore finishes before the test returns, and can no longer read the next test's onDegreeSnapshotLoad hook. This is a test-only change. Under load, the race went from 5/200 processes to 0/200.
Review nits (moving the join into t.Cleanup, so it also runs on the failure path) are noted on #237.
Activity
Merge pull request #234 from dborup/codex/issue-224-227-race-flakes
dborup commentedon Oct 5, 2026
Fixed by #234 (merged as
3878d7ea).TestReachRank_ExpiredSnapshotAlwaysRefreshesnow ends withawaitDegreeRefresh, which joins the"degree"singleflight key once more. A late refresh that a caller registered therefore finishes before the test returns, and can no longer read the next test'sonDegreeSnapshotLoadhook. This is a test-only change. Under load, the race went from 5/200 processes to 0/200.Review nits (moving the join into
t.Cleanup, so it also runs on the failure path) are noted on #237.