Skip to content

fix(test): race-aware sizing for two timing-sensitive tests - #332

Merged
jkyberneees merged 1 commit into
mainfrom
fix/race-timing-tests
Oct 18, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
fix/race-timing-tests

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Locally, go test -race ./... -count=1 (the command in AGENTS.md) failed two tests every time, on main as well. CI did not catch it because it runs with -short.

Test Cause Fix
internal/redact TestRED_RedactCredentialNamesScaleLinearly The 10s limit for a 1 MiB input also applied under -race, which is 5–10× slower Skip the wall-clock limit under race (!raceEnabled && !testing.Short()), the same guard used in redhunt_2026_10_12b_final_test.go. The 64→256 KiB linear-scaling check still runs under race.
cmd/odek TestRED_RunsFinishedRunPinsAgentAndSession The test built a 6 MiB session under -race, though the heap check that needs it is skipped under race. Each run took more than the 60s wait. Use the -short size under race too. The structural no-pinning check still runs in every mode, and the heap check runs without race at full size.

Without race, both tests check exactly what they did before.

Test plan

  • Both tests pass with -race and without.
  • go test -race ./... -count=1 -timeout 900s passes in full locally.
  • go vet, gofmt

🤖 Generated with Claude Code

TestRED_RedactCredentialNamesScaleLinearly applied its 1 MiB wall-clock
budget under -race, and TestRED_RunsFinishedRunPinsAgentAndSession built a
6 MiB session under -race although its heap check is skipped there. Both
failed the documented 'go test -race ./... -count=1' locally. Follow the
existing raceEnabled pattern; non-race runs keep the full checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek 0d30062 Commit Preview URL

Branch Preview URL
Oct 18 2026, 12:16 PM

@jkyberneees
jkyberneees merged commit 479669d into main Oct 18, 2026
10 checks passed
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