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>
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)