1
0
mirror of https://github.com/golang/go synced 2024-11-19 12:54:45 -07:00

net/http: fix benchmark goroutine leak

New detection because of net/http now using TestMain.

Fixes #9033

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews, rsc
https://golang.org/cl/170210043
This commit is contained in:
Brad Fitzpatrick 2014-11-08 15:13:28 -03:00
parent 1340c6d593
commit cf105e2fa0

View File

@ -2819,6 +2819,7 @@ func benchmarkClientServerParallel(b *testing.B, parallelism int, useTLS bool) {
InsecureSkipVerify: true, InsecureSkipVerify: true,
}, },
} }
defer noVerifyTransport.CloseIdleConnections()
client := &Client{Transport: noVerifyTransport} client := &Client{Transport: noVerifyTransport}
for pb.Next() { for pb.Next() {
res, err := client.Get(ts.URL) res, err := client.Get(ts.URL)