From: Brad Fitzpatrick Date: Wed, 1 Mar 2017 17:44:11 +0000 (+0000) Subject: net/http: deflake TestClientRedirect308NoGetBody X-Git-Tag: go1.9beta1~1360 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ffe923f6f427f5ab47f4e1f4584369212add07e2;p=gostls13.git net/http: deflake TestClientRedirect308NoGetBody In an unrelated CL I found a way to increase the likelihood of latent flaky tests and found this one. This is just like yesterday's https://golang.org/cl/37624 and dozens before it (all remnants from the great net/http test parallelization of Nov 2016 in https://golang.org/cl/32684). Change-Id: I3fe61d1645062e5109206ff27d74f573ef6ebb2e Reviewed-on: https://go-review.googlesource.com/37627 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Josh Bleecher Snyder --- diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go index 105b310c6a..534986e867 100644 --- a/src/net/http/client_test.go +++ b/src/net/http/client_test.go @@ -583,8 +583,9 @@ func TestClientRedirect308NoGetBody(t *testing.T) { if err != nil { t.Fatal(err) } + c := &Client{Transport: &Transport{DisableKeepAlives: true}} req.GetBody = nil // so it can't rewind. - res, err := DefaultClient.Do(req) + res, err := c.Do(req) if err != nil { t.Fatal(err) }