The testing framework uses runtime.Goexit() when a test fails which still allows the defer calls to execute. That's why we should use defer to close the done channel to allow all goroutines to exit properly.