]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: fix broken TestIssue4191_InfiniteGetToPutTimeout
authorAlex Brainman <alex.brainman@gmail.com>
Wed, 28 Nov 2012 06:00:50 +0000 (17:00 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Wed, 28 Nov 2012 06:00:50 +0000 (17:00 +1100)
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

src/pkg/net/http/transport_test.go

index a594fa81d9e144dfbcd2b7db6eb90b6a1882cd50..2f4eb88f96fff510f13cfaf6a1ee3eb1ed9b614f 100644 (file)
@@ -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")