]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove workaround in TestTransportClosesBodyOnError on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Thu, 20 Oct 2016 14:51:03 +0000 (16:51 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 20 Oct 2016 15:07:24 +0000 (15:07 +0000)
This issue has been fixed in CL 31390.

Fixes #9554.

Change-Id: Ib8ff4cb1ffcb7cdbf117510b98b4a7e13e4efd2b
Reviewed-on: https://go-review.googlesource.com/31520
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/transport_test.go

index 147b468e788ca6d8a3f94bc46b2342ba6691f881..083fedefe0d9069dbda132b8b4acc051bcd9ec5e 100644 (file)
@@ -2485,22 +2485,6 @@ type errorReader struct {
 
 func (e errorReader) Read(p []byte) (int, error) { return 0, e.err }
 
-type plan9SleepReader struct{}
-
-func (plan9SleepReader) Read(p []byte) (int, error) {
-       if runtime.GOOS == "plan9" {
-               // After the fix to unblock TCP Reads in
-               // https://golang.org/cl/15941, this sleep is required
-               // on plan9 to make sure TCP Writes before an
-               // immediate TCP close go out on the wire. On Plan 9,
-               // it seems that a hangup of a TCP connection with
-               // queued data doesn't send the queued data first.
-               // https://golang.org/issue/9554
-               time.Sleep(50 * time.Millisecond)
-       }
-       return 0, io.EOF
-}
-
 type closerFunc func() error
 
 func (f closerFunc) Close() error { return f() }
@@ -2595,7 +2579,7 @@ func TestTransportClosesBodyOnError(t *testing.T) {
                io.Reader
                io.Closer
        }{
-               io.MultiReader(io.LimitReader(neverEnding('x'), 1<<20), plan9SleepReader{}, errorReader{fakeErr}),
+               io.MultiReader(io.LimitReader(neverEnding('x'), 1<<20), errorReader{fakeErr}),
                closerFunc(func() error {
                        select {
                        case didClose <- true: