]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: deflake TestServerAllowsBlockingRemoteAddr more
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 20 Mar 2017 16:44:34 +0000 (16:44 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 20 Mar 2017 17:32:16 +0000 (17:32 +0000)
As noted in https://github.com/golang/go/issues/19161#issuecomment-287554171,
CL 37771 (adding use of the new httptest.Server.Client to all net/http
tests) accidentally reverted DisableKeepAlives for this test. For
many tests, DisableKeepAlives was just present to prevent goroutines
from staying active after the test exited.  In this case it might
actually be important. (We'll see)

Updates #19161

Change-Id: I11f889f86c932b51b11846560b68dbe5993cdfc3
Reviewed-on: https://go-review.googlesource.com/38373
Reviewed-by: Michael Munday <munday@ca.ibm.com>
src/net/http/serve_test.go

index 795bc207c648ab5d3ae0e225e13e13feb2003c97..451b3b6467bfdb0942da6f41f3c7e907747ce6df 100644 (file)
@@ -962,6 +962,8 @@ func TestServerAllowsBlockingRemoteAddr(t *testing.T) {
 
        c := ts.Client()
        c.Timeout = time.Second
+       // Force separate connection for each:
+       c.Transport.(*Transport).DisableKeepAlives = true
 
        fetch := func(num int, response chan<- string) {
                resp, err := c.Get(ts.URL)