diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2020-05-16 11:54:57 +0200 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2020-05-16 11:54:57 +0200 |
commit | 05d4602a684fd8049eebeef4b9dfdbea116b54f4 (patch) | |
tree | 8a09ee2320fe6c9e0d36701b9831d00bd7d09d98 /client_test.go | |
parent | Don't wrap conn with a TLS Client if it's already a TLS Conn (diff) | |
download | fasthttp-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.go | 4 |
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()) } |