]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: deflake TestClientRedirect308NoGetBody
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 1 Mar 2017 17:44:11 +0000 (17:44 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 1 Mar 2017 21:03:57 +0000 (21:03 +0000)
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 <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/net/http/client_test.go

index 105b310c6a505a21ae6e060aaa4a12f2c565168a..534986e86753aed3c74e8e0db092c924f5ec8a32 100644 (file)
@@ -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)
        }