Skip to content

testing: Fuzz testing with fuzztime flag sometimes fails incorrectly with "context deadline exceeded" #75804

Closed

Description

@erap320

Go version

go1.25.0 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/elia.battiston/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/elia.battiston/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/9_/ds0mpwns1nx7lw0mpwl4klk40000gq/T/go-build2080843811=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/elia.battiston/git/go-1.25.0-fuzztime-bug/go.mod'
GOMODCACHE='/Users/elia.battiston/go/pkg/mod'
GONOPROXY='github.com'
GONOSUMDB='github.com'
GOOS='darwin'
GOPATH='/Users/elia.battiston/go'
GOPRIVATE='github.com'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/elia.battiston/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.darwin-arm64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/elia.battiston/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/elia.battiston/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.darwin-arm64/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.0'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I created a fuzz test on a function that cannot fail.
I then repeatedly executed fuzz testing with a maximum duration of 5s, with the following command:
go test . -fuzz="FuzzImpossibleFailure" -fuzztime=5s

The minimal example to reproduce the issue can be found here: https://github.com/erap320/go-1.25.0-fuzztime-bug

What did you see happen?

After many executions, one of them fails with the following output:

ok      fuzztest        5.307s
fuzz: elapsed: 0s, gathering baseline coverage: 0/3 completed
fuzz: elapsed: 0s, gathering baseline coverage: 3/3 completed, now fuzzing with 10 workers
fuzz: elapsed: 3s, execs: 1026946 (342299/sec), new interesting: 0 (total: 3)
fuzz: elapsed: 5s, execs: 1755480 (346861/sec), new interesting: 0 (total: 3)
--- FAIL: FuzzImpossibleFailure (5.10s)
    context deadline exceeded
FAIL
exit status 1
FAIL    fuzztest        5.314s

This seems related to #72104

What did you expect to see?

I would not expect the fuzzing process to fail unless the tested function fails

Activity

  1. changed the title [-]testing/fuzz.go: Fuzz testing with `fuzztime` flag sometimes fails incorrectly[/-] [+]cmd/go: Fuzz testing with `fuzztime` flag sometimes fails incorrectly with "context deadline exceeded"[/+] on Oct 8, 2025
  2. added
    BugReportIssues describing a possible bug in the Go implementation.
    on Oct 8, 2025
  3. changed the title [-]cmd/go: Fuzz testing with `fuzztime` flag sometimes fails incorrectly with "context deadline exceeded"[/-] [+]testing: Fuzz testing with `fuzztime` flag sometimes fails incorrectly with "context deadline exceeded"[/+] on Oct 8, 2025
  4. prattmic commented on Oct 8, 2025

    @prattmic
    Member

    cc @adonovan @neild @golang/fuzzing

  5. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Oct 8, 2025
  6. karalabe commented on Jan 7, 2026

    @karalabe
    Contributor

    I've also started seeing this today.

    go version go1.26rc1 darwin/arm64
    
  7. desertwitch commented on Jan 30, 2026

    @desertwitch

    I'm also seeing this with:

    go version go1.25.5 linux/amd64
    
  8. TomSellers commented on May 4, 2026

    @TomSellers

    Seeing this constantly on different fuzzers in a a script that I use to loop over all of the 400+ fuzzers in my codebase. Its rarely the same fuzzer that triggers this. I've seen it when using fuzztime of 3 seconds all the way up to 10s of minutes. It's causing our scheduled fuzzing runs to fail in various places.

    go version go1.26.2 linux/amd64

    EDIT:
    Adding go version go1.26.2 darwin/arm64

    With a fuzztime=5s

    fuzz: elapsed: 0s, gathering baseline coverage: 0/52 completed
    fuzz: elapsed: 0s, gathering baseline coverage: 52/52 completed, now fuzzing with 16 workers
    fuzz: elapsed: 3s, execs: 621649 (207144/sec), new interesting: 1 (total: 53)
    fuzz: elapsed: 5s, execs: 621649 (0/sec), new interesting: 1 (total: 53)
    --- FAIL: FUZZERNAMEHERE (5.02s)
        context deadline exceeded
    FAIL
    exit status 1
    
  9. gopherbot commented on May 5, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/774140 mentions this issue: internal/fuzz: fix race between context deadline and error suppression

  10. TomSellers commented on Jul 22, 2026

    @TomSellers

    How do we get this fix on someone's radar? It has been breaking workflows for months.

    @golang/fuzzing

  11. klauspost commented on Jul 22, 2026

    @klauspost
    Contributor

    Yeah. Seems we'll have to wait another cycle. For what it's worth I'm using -fuzztime=1000000x and similar until the CL is merged.

  12. TomSellers commented on Jul 22, 2026

    @TomSellers

    Thanks for the update and PR @klauspost
    My workflow loops over several hundred fuzz tests and then does so again in 32 bit (GOARCH=386). It does so for a specified amount of time. Breaking mid-way through a loop is super frustrating.

  13. 57 remaining items

  14. added a commit that references this issue on Oct 24, 2026
  15. added this to the Go1.28 milestone on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions