You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proposal: testing: design a deterministic concurrency testing framework for Go #80316
Concurrent Go code is hard to test reliably. The Go scheduler is non-deterministic, so a bug can hide through thousands of test runs and then fail unpredictably in production. Existing tools do not fully solve this:
-race only observes the single execution that ran. It misses schedule-dependent logic bugs in correctly-synchronized code, and it can miss races if the unlucky interleaving never occurs.
testing/synctest provides deterministic time and isolation, but does not systematically explore interleavings.
Manual tricks like time.Sleep or runtime.Gosched are fragile and unreliable.
The result is a class of heisenbugs that developers cannot confidently catch or reproduce.
Proposal
Design a deterministic concurrency testing framework for Go. The framework runs ordinary concurrent unit tests inside a closed bubble, takes over goroutine scheduling at synchronization points, and systematically explores the relevant interleavings. When it finds a panic, deadlock, leak, or invariant violation, it reports a reproducible trace and a replay seed.
This requires cooperation across three parts of the toolchain:
Runtime: pause and resume goroutines at synchronization points inside the test bubble, without affecting normal execution.
Compiler: provide an opt-in instrumentation mode that turns shared-memory accesses and atomic operations into observable scheduling points.
Testing API: expose the framework through a small package such as testing/weave, with an entry point that runs the model repeatedly and reports failures with replay seeds.
Oh! There are lots of closed proposals. I made claude to write a quick and dirty demo, it works, with many limitations. I can find some time to learn from previous proposals.
Activity
seankhliao commentedon Jul 9, 2026
This isn't an actionable proposal for the Go project, you have to do the design work up front and an implementation before it's suitable for review.
gabyhelp commentedon Jul 9, 2026
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
myzhan commentedon Jul 9, 2026
Oh! There are lots of closed proposals. I made claude to write a quick and dirty demo, it works, with many limitations. I can find some time to learn from previous proposals.