ci: use a count-based fuzztime limit to dodge a Go toolchain race - #229
Merged
Conversation
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>
etiennep
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Run Fuzz TestsCI step (go test -fuzz=FuzzAppendSanitizedMetricName -fuzztime=5s -parallel=2 ./datadog) intermittently fails with a barecontext deadline exceededand no crasher input.internal/fuzzpackage (golang/go#75804): the context deadline used to stop workers at the end of-fuzztimecan leak past the code meant to suppress it as a normal stop signal.888a447,stableGo leg only, go1.26.5) — matches the upstream repro output byte-for-byte, and reproduces regardless of-fuzztimeduration per the Go team's own testing (seen from 3s to 10+ minutes). The fix (CL 804900) only merged intorelease-branch.go1.27on 2026-07-23 and isn't in any released stable/oldstable toolchain yet.-fuzztime=1000000x) instead of a wall-clock duration, which avoids thecontext.WithTimeoutdeadline path entirely and sidesteps the race rather than gambling on duration.Test plan
go test -fuzz=FuzzAppendSanitizedMetricName -fuzztime=1000000x -parallel=2 ./datadoglocally — stops precisely atexecs: 1000000, passes cleanly (~14s).🤖 Generated with Claude Code