Skip to content

test(duplicates): scale the scan time budget under the race detector - #2880

Merged
vavallee merged 1 commit into
mainfrom
fix/duplicates-scan-race-budget
Oct 1, 2026
Merged

vavallee merged 1 commit into
mainfrom
fix/duplicates-scan-race-budget

Conversation

@vavallee

@vavallee vavallee commented Oct 1, 2026

Copy link
Copy Markdown
Owner

main race (non-api) failed at 692376c: TestScanScale took 129.99ms against a 100ms budget under -race. Adds a raceEnabled build tag constant (test files only) and multiplies the budget by 10 when it is on. Normal runs keep 100ms.

Verified: go test -count=3 and go test -race -count=3 on internal/duplicates both pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9

TestScanScale asserted Scan(500 books) under 100ms, which failed on a
shared runner under -race (130ms) and turned main's race (non-api) shard
red at 692376c. The budget is ten times larger when the race detector
is on; the normal budget is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9
Signed-off-by: vavallee <vavallee@protonmail.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix for the flaky TestScanScale failure under -race.

The //go:build race / //go:build !race pair in race_on_test.go / race_off_test.go is the standard Go stdlib idiom for this — no concerns there. The 10× multiplier is conservative but defensible for shared CI runners; the race detector typically inflates wall-clock 5–20×.

One minor note: the comment at internal/duplicates/duplicates_test.go:584 repeats the explanation already in race_on_test.go:6. Either location is fine, but both is mild duplication. Not a blocker.

— 🤖 Bindery triage bot (automated). Reply to correct me; a human will see it.

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vavallee
vavallee merged commit adc9b81 into main Oct 1, 2026
40 of 41 checks passed
@vavallee
vavallee deleted the fix/duplicates-scan-race-budget branch October 1, 2026 03:27
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