Skip to content

ci: use a count-based fuzztime limit to dodge a Go toolchain race - #229

Merged
kevinburkesegment merged 1 commit into
mainfrom
fuzztime-count-based
Jul 30, 2026
Merged

ci: use a count-based fuzztime limit to dodge a Go toolchain race#229
kevinburkesegment merged 1 commit into
mainfrom
fuzztime-count-based

Conversation

@kevinburkesegment

Copy link
Copy Markdown
Contributor

Summary

  • The Run Fuzz Tests CI step (go test -fuzz=FuzzAppendSanitizedMetricName -fuzztime=5s -parallel=2 ./datadog) intermittently fails with a bare context deadline exceeded and no crasher input.
  • This is a known, currently-unfixed race in Go's internal/fuzz package (golang/go#75804): the context deadline used to stop workers at the end of -fuzztime can leak past the code meant to suppress it as a normal stop signal.
  • Confirmed this against the exact CI failure (run 30568362844, commit 888a447, stable Go leg only, go1.26.5) — matches the upstream repro output byte-for-byte, and reproduces regardless of -fuzztime duration per the Go team's own testing (seen from 3s to 10+ minutes). The fix (CL 804900) only merged into release-branch.go1.27 on 2026-07-23 and isn't in any released stable/oldstable toolchain yet.
  • Switches to a count-based limit (-fuzztime=1000000x) instead of a wall-clock duration, which avoids the context.WithTimeout deadline path entirely and sidesteps the race rather than gambling on duration.

Test plan

  • Ran go test -fuzz=FuzzAppendSanitizedMetricName -fuzztime=1000000x -parallel=2 ./datadog locally — stops precisely at execs: 1000000, passes cleanly (~14s).
  • CI passes on this PR.

🤖 Generated with Claude Code

Duration-based -fuzztime (e.g. 5s) hits a known unfixed race in
internal/fuzz where the context deadline used to stop workers can
leak past the code that's supposed to suppress it as a normal stop
signal, failing the run with a bare "context deadline exceeded" and
no crasher input (golang/go#75804). Confirmed against upstream repro
output and the Go team's own workaround: reproduces regardless of
fuzztime length (seen from 3s to 10+ minutes upstream), and the fix
(CL 804900) only just landed in release-branch.go1.27, not yet in any
released stable/oldstable toolchain.

Switching to a count-based limit (Nx) avoids the wall-clock deadline
context entirely, sidestepping the race rather than gambling that a
longer duration makes it less likely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kevinburkesegment
kevinburkesegment merged commit 56b5b31 into main Jul 30, 2026
14 checks passed
@kevinburkesegment
kevinburkesegment deleted the fuzztime-count-based branch July 30, 2026 21:59
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.

2 participants