From: Dmitry Vyukov Date: Wed, 28 Jan 2015 13:17:36 +0000 (+0300) Subject: net/http: fix goroutine leak in benchmark X-Git-Tag: go1.5beta1~2248 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8bc30e07338d8a8d4a972261e4ff25fa85cec921;p=gostls13.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 --- diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 8086ef0800..6839865658 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -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) {