Commit eb6c1dd7 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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/38373Reviewed-by: default avatarMichael Munday <munday@ca.ibm.com>
parent d80166eb
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment