Testing Concurrent Go Code with synctest
Stop sleeping in concurrent Go tests.
Testing concurrent Go code has always required a bit of discipline. Goroutines are cheap, channels are simple, and context cancellation is idiomatic — background workers and timers are everywhere in real Go services.