over function (handy, though not just for tests) • Go 1.24: testing.B.Loop() and my favorite t.Context(), and go vet • Go 1.25: testing/synctest for determinism and AllocsPerRun improvement You and the ecosystem: tools like testcontainers-go and our improved skill and practice!
time.Sleep take wall time to complete • Testing goroutines ends up needing sync.Waitgroup or blocking practice • Race conditions and things like context cancelation code is hard to reach
stable state Deterministic Scheduling: Predictable goroutine execution order State Detection: "Durably blocked" means blocked on channels, select, or sleep Network I/O operations cannot span bubble boundaries Goroutine creation must occur within bubble context
break synctest bubbles. Goroutines blocked on actual network I/O are not durably blocked in synctest terms, which means: 1. synctest.Wait() won't work - it can't detect when all goroutines are properly blocked 2. Time won't advance - the bubble can't become idle 3. Tests become unreliable - mixing real network with synthetic time creates race conditions
I showed were real stories • Don’t forget the old good: t.Setenv t.Context etc keep doing it! • Be mindful of where your code goes: Using lighter abstractions makes testing easier • synctest may require you to tinker: Sometimes the refactoring was needed anyway • This is all new: don’t trust your LLM’s knowledge.. Feed it synctest docs!
Envoy AI Gateway - LLM and (soon) MCP gateway https://github.com/envoyproxy/ai-gateway Connect - browser and gRPC compatible APIs https://github.com/connectrpc/connect-go func-e - fetches and runs Envoy as a subprocess https://github.com/tetratelabs/func-e https://pkg.go.dev/testing/synctest@master