Commit cf105e2f authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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
parent 1340c6d5
...@@ -2819,6 +2819,7 @@ func benchmarkClientServerParallel(b *testing.B, parallelism int, useTLS bool) { ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment