mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: fix flaky TestClientRedirect308NoLocation
This was a t.Parallel test but it was using the global DefaultTransport via the global Get func. Use a private Transport that won't have its CloseIdleConnections etc methods called by other tests. (I hit this flake myself while testing a different change.) Change-Id: If0665e3e8580ee198f8e5f3079bfaea55f036eca Reviewed-on: https://go-review.googlesource.com/37624 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
6d32b1a343
commit
3123df3464
1 changed files with 2 additions and 1 deletions
|
|
@ -555,7 +555,8 @@ func TestClientRedirect308NoLocation(t *testing.T) {
|
|||
w.WriteHeader(308)
|
||||
}))
|
||||
defer ts.Close()
|
||||
res, err := Get(ts.URL)
|
||||
c := &Client{Transport: &Transport{DisableKeepAlives: true}}
|
||||
res, err := c.Get(ts.URL)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue