aboutsummaryrefslogtreecommitdiff
path: root/client_test.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2020-05-16 11:54:57 +0200
committerGravatar Erik Dubbelboer <erik@dubbelboer.com> 2020-05-16 11:54:57 +0200
commit05d4602a684fd8049eebeef4b9dfdbea116b54f4 (patch)
tree8a09ee2320fe6c9e0d36701b9831d00bd7d09d98 /client_test.go
parentDon't wrap conn with a TLS Client if it's already a TLS Conn (diff)
downloadfasthttp-05d4602a684fd8049eebeef4b9dfdbea116b54f4.tar.gz
fasthttp-05d4602a684fd8049eebeef4b9dfdbea116b54f4.tar.bz2
fasthttp-05d4602a684fd8049eebeef4b9dfdbea116b54f4.zip
Fix race condition in test
Diffstat (limited to 'client_test.go')
-rw-r--r--client_test.go4
1 files changed, 4 insertions, 0 deletions
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())
}