From: Brad Fitzpatrick Date: Mon, 20 Mar 2017 16:44:34 +0000 (+0000) Subject: net/http: deflake TestServerAllowsBlockingRemoteAddr more X-Git-Tag: go1.9beta1~1097 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=eb6c1dd7ebd7035978eda533d1c0470261306bff;p=gostls13.git net/http: deflake TestServerAllowsBlockingRemoteAddr more 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 --- diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 795bc207c6..451b3b6467 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -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)