From: Alex Brainman Date: Wed, 28 Nov 2012 06:00:50 +0000 (+1100) Subject: net/http: fix broken TestIssue4191_InfiniteGetToPutTimeout X-Git-Tag: go1.1rc2~1759 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b5aa4789f93be669696f2a9b95eb018b931993d8;p=gostls13.git net/http: fix broken TestIssue4191_InfiniteGetToPutTimeout Test creates 2 tcp connections for put and get. Make sure these are closed properly after test is over, otherwise server hangs waiting for connection to be closed. R=golang-dev, bradfitz, dave CC=golang-dev https://golang.org/cl/6842109 --- diff --git a/src/pkg/net/http/transport_test.go b/src/pkg/net/http/transport_test.go index a594fa81d9..2f4eb88f96 100644 --- a/src/pkg/net/http/transport_test.go +++ b/src/pkg/net/http/transport_test.go @@ -996,9 +996,11 @@ func TestIssue4191_InfiniteGetToPutTimeout(t *testing.T) { req, _ := NewRequest("PUT", ts.URL+"/put", sres.Body) _, err = client.Do(req) if err == nil { + sres.Body.Close() t.Errorf("Unexpected successful PUT") break } + sres.Body.Close() } if debug { println("tests complete; waiting for handlers to finish")