Fix race condition in test

This commit is contained in:
Erik Dubbelboer
2020-05-16 11:54:57 +02:00
parent 9507d7c7d7
commit 05d4602a68
+4
View File
@@ -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())
}