|
@@ -832,6 +832,10 @@ func testTransportReqBodyAfterResponse(t *testing.T, status int) {
|
|
|
ct := newClientTester(t)
|
|
ct := newClientTester(t)
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
defer close(clientDone)
|
|
defer close(clientDone)
|
|
|
|
|
|
|
|
var n int64 // atomic
|
|
var n int64 // atomic
|
|
@@ -2693,6 +2697,10 @@ func testTransportUsesGoAwayDebugError(t *testing.T, failMidBody bool) {
|
|
|
ct.fr.WriteGoAway(5, ErrCodeNo, []byte(goAwayDebugData))
|
|
ct.fr.WriteGoAway(5, ErrCodeNo, []byte(goAwayDebugData))
|
|
|
ct.fr.WriteGoAway(5, goAwayErrCode, nil)
|
|
ct.fr.WriteGoAway(5, goAwayErrCode, nil)
|
|
|
ct.sc.(*net.TCPConn).CloseWrite()
|
|
ct.sc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ ct.sc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
<-clientDone
|
|
<-clientDone
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
@@ -2821,6 +2829,10 @@ func TestTransportAdjustsFlowControl(t *testing.T) {
|
|
|
|
|
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
defer close(clientDone)
|
|
defer close(clientDone)
|
|
|
|
|
|
|
|
req, _ := http.NewRequest("POST", "https://dummy.tld/", struct{ io.Reader }{io.LimitReader(neverEnding('A'), bodySize)})
|
|
req, _ := http.NewRequest("POST", "https://dummy.tld/", struct{ io.Reader }{io.LimitReader(neverEnding('A'), bodySize)})
|
|
@@ -3449,6 +3461,10 @@ func TestTransportRetryAfterRefusedStream(t *testing.T) {
|
|
|
ct := newClientTester(t)
|
|
ct := newClientTester(t)
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
defer close(clientDone)
|
|
defer close(clientDone)
|
|
|
req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
|
|
req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
|
|
|
resp, err := ct.tr.RoundTrip(req)
|
|
resp, err := ct.tr.RoundTrip(req)
|
|
@@ -3515,6 +3531,10 @@ func TestTransportRetryHasLimit(t *testing.T) {
|
|
|
ct := newClientTester(t)
|
|
ct := newClientTester(t)
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
defer close(clientDone)
|
|
defer close(clientDone)
|
|
|
req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
|
|
req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
|
|
|
resp, err := ct.tr.RoundTrip(req)
|
|
resp, err := ct.tr.RoundTrip(req)
|
|
@@ -3563,6 +3583,10 @@ func TestTransportResponseDataBeforeHeaders(t *testing.T) {
|
|
|
ct := newClientTester(t)
|
|
ct := newClientTester(t)
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
req := httptest.NewRequest("GET", "https://dummy.tld/", nil)
|
|
req := httptest.NewRequest("GET", "https://dummy.tld/", nil)
|
|
|
// First request is normal to ensure the check is per stream and not per connection.
|
|
// First request is normal to ensure the check is per stream and not per connection.
|
|
|
_, err := ct.tr.RoundTrip(req)
|
|
_, err := ct.tr.RoundTrip(req)
|
|
@@ -3675,6 +3699,10 @@ func TestTransportRequestsStallAtServerLimit(t *testing.T) {
|
|
|
wg.Wait()
|
|
wg.Wait()
|
|
|
close(clientDone)
|
|
close(clientDone)
|
|
|
ct.cc.(*net.TCPConn).CloseWrite()
|
|
ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
}()
|
|
}()
|
|
|
for k := 0; k < maxConcurrent+2; k++ {
|
|
for k := 0; k < maxConcurrent+2; k++ {
|
|
|
wg.Add(1)
|
|
wg.Add(1)
|
|
@@ -4295,6 +4323,10 @@ func testTransportBodyReadError(t *testing.T, body []byte) {
|
|
|
ct := newClientTester(t)
|
|
ct := newClientTester(t)
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
defer close(clientDone)
|
|
defer close(clientDone)
|
|
|
|
|
|
|
|
checkNoStreams := func() error {
|
|
checkNoStreams := func() error {
|
|
@@ -4383,6 +4415,10 @@ func TestTransportBodyEagerEndStream(t *testing.T) {
|
|
|
ct := newClientTester(t)
|
|
ct := newClientTester(t)
|
|
|
ct.client = func() error {
|
|
ct.client = func() error {
|
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
defer ct.cc.(*net.TCPConn).CloseWrite()
|
|
|
|
|
+ if runtime.GOOS == "plan9" {
|
|
|
|
|
+ // CloseWrite not supported on Plan 9; Issue 17906
|
|
|
|
|
+ defer ct.cc.(*net.TCPConn).Close()
|
|
|
|
|
+ }
|
|
|
body := strings.NewReader(reqBody)
|
|
body := strings.NewReader(reqBody)
|
|
|
req, err := http.NewRequest("PUT", "https://dummy.tld/", body)
|
|
req, err := http.NewRequest("PUT", "https://dummy.tld/", body)
|
|
|
if err != nil {
|
|
if err != nil {
|