Avoid sleeping in tests

How do you usually deal with testing methods that spawn various goroutines? In the case of a single routine, I’ve seen people suggest returning <-chan struct{} and just <- ch in the test, or select with a timeout....

Read More
Loading