mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
Each ForkReap call started a reap.ReapChildren goroutine that never stopped (done=nil). Goroutines accumulated across subtests, racing to call Wait4(-1, WNOHANG) and stealing the child's wait status before ForkReap's Wait4(pid) could collect it. Add a WithDone option to pass the done channel through to ReapChildren, and use it in tests via a withDone(t) helper.