net/http: fix goroutine leak in benchmark

Race builders report goroutine leaks after addition of this benchmark:
http://build.golang.org/log/18e47f4cbc18ee8db125e1f1157573dd1e333c41
Close idle connection in default transport.

Change-Id: I86ff7b2e0972ed47c5ebcb9fce19e7f39d3ff530
Reviewed-on: https://go-review.googlesource.com/3412
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Dmitry Vyukov 2015-01-28 16:17:36 +03:00
parent 67f8a81316
commit 8bc30e0733
1 changed files with 1 additions and 0 deletions

View File

@ -2977,6 +2977,7 @@ func BenchmarkClient(b *testing.B) {
case <-time.After(5 * time.Second):
b.Fatalf("subprocess did not stop")
}
DefaultTransport.(*Transport).CloseIdleConnections()
}
func BenchmarkServerFakeConnNoKeepAlive(b *testing.B) {