aboutsummaryrefslogtreecommitdiff
path: root/client_test.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2021-06-18 15:28:58 +0200
committerGravatar Erik Dubbelboer <erik@dubbelboer.com> 2021-06-18 15:28:58 +0200
commit410bde60095d39d9e976277addabd400ed667901 (patch)
treef0f75c1cee07de59ac14f941caaefbaa2c3bf7bb /client_test.go
parentLower go test time (diff)
downloadfasthttp-410bde60095d39d9e976277addabd400ed667901.tar.gz
fasthttp-410bde60095d39d9e976277addabd400ed667901.tar.bz2
fasthttp-410bde60095d39d9e976277addabd400ed667901.zip
Fix race condition in TestPipelineClientIssue832
Diffstat (limited to 'client_test.go')
-rw-r--r--client_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/client_test.go b/client_test.go
index 5c00809..9775ba0 100644
--- a/client_test.go
+++ b/client_test.go
@@ -126,11 +126,12 @@ func TestPipelineClientIssue832(t *testing.T) {
ln := fasthttputil.NewInmemoryListener()
req := AcquireRequest()
- defer ReleaseRequest(req)
+ // Don't defer ReleaseRequest as we use it in a goroutine that might not be done at the end.
+
req.SetHost("example.com")
res := AcquireResponse()
- defer ReleaseResponse(res)
+ // Don't defer ReleaseResponse as we use it in a goroutine that might not be done at the end.
client := PipelineClient{
Dial: func(addr string) (net.Conn, error) {