mirror of https://github.com/golang/go.git
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:
parent
67f8a81316
commit
8bc30e0733
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue