Commit f9bbfe4a authored by David du Colombier's avatar David du Colombier Committed by Brad Fitzpatrick

net/http: remove workaround in TestTransportClosesBodyOnError on Plan 9

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 8589049d
...@@ -2485,22 +2485,6 @@ type errorReader struct { ...@@ -2485,22 +2485,6 @@ type errorReader struct {
func (e errorReader) Read(p []byte) (int, error) { return 0, e.err } 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 type closerFunc func() error
func (f closerFunc) Close() error { return f() } func (f closerFunc) Close() error { return f() }
...@@ -2595,7 +2579,7 @@ func TestTransportClosesBodyOnError(t *testing.T) { ...@@ -2595,7 +2579,7 @@ func TestTransportClosesBodyOnError(t *testing.T) {
io.Reader io.Reader
io.Closer 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 { closerFunc(func() error {
select { select {
case didClose <- true: case didClose <- true:
......
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