diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2021-06-18 15:28:58 +0200 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2021-06-18 15:28:58 +0200 |
commit | 410bde60095d39d9e976277addabd400ed667901 (patch) | |
tree | f0f75c1cee07de59ac14f941caaefbaa2c3bf7bb /client_test.go | |
parent | Lower go test time (diff) | |
download | fasthttp-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.go | 5 |
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) { |