diff --git a/client_test.go b/client_test.go index 3f9bc77..9b5fafc 100644 --- a/client_test.go +++ b/client_test.go @@ -2295,6 +2295,10 @@ func TestHostClientMaxConnWaitTimeoutError(t *testing.T) { } wg.Wait() + // Prevent a race condition with the conns cleaner that might still be running. + c.connsLock.Lock() + defer c.connsLock.Unlock() + if c.connsWait.len() > 0 { t.Errorf("connsWait has %v items remaining", c.connsWait.len()) }