Skip to content

Commit 7164fad

Browse files
neildgopherbot
authored andcommitted
net/http: disable flaky 100-continue tests
Disable three 100-continue tests that aren't exercising the intended behavior because they don't set ExpectContinueTimeout. The tests are flaky right now; setting ExpectContinueTimeout makes them consistently fail. Set ExpectContinueTimeout and t.Skip the tests for now. Fixes #67382 For #67555 Change-Id: I459a19a927e14af03881e89c73d20c93cf0da43e Reviewed-on: https://go-review.googlesource.com/c/go/+/587155 Auto-Submit: Damien Neil <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 5a9dabc commit 7164fad

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/net/http/serve_test.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -7171,13 +7171,16 @@ func TestServerReadAfterWriteHeader100Continue(t *testing.T) {
71717171
run(t, testServerReadAfterWriteHeader100Continue)
71727172
}
71737173
func testServerReadAfterWriteHeader100Continue(t *testing.T, mode testMode) {
7174+
t.Skip("https://go.dev/issue/67555")
71747175
body := []byte("body")
71757176
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
71767177
w.WriteHeader(200)
71777178
NewResponseController(w).Flush()
71787179
io.ReadAll(r.Body)
71797180
w.Write(body)
7180-
}))
7181+
}), func(tr *Transport) {
7182+
tr.ExpectContinueTimeout = 24 * time.Hour // forever
7183+
})
71817184

71827185
req, _ := NewRequest("GET", cst.ts.URL, strings.NewReader("body"))
71837186
req.Header.Set("Expect", "100-continue")
@@ -7199,14 +7202,17 @@ func TestServerReadAfterHandlerDone100Continue(t *testing.T) {
71997202
run(t, testServerReadAfterHandlerDone100Continue)
72007203
}
72017204
func testServerReadAfterHandlerDone100Continue(t *testing.T, mode testMode) {
7205+
t.Skip("https://go.dev/issue/67555")
72027206
readyc := make(chan struct{})
72037207
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
72047208
go func() {
72057209
<-readyc
72067210
io.ReadAll(r.Body)
72077211
<-readyc
72087212
}()
7209-
}))
7213+
}), func(tr *Transport) {
7214+
tr.ExpectContinueTimeout = 24 * time.Hour // forever
7215+
})
72107216

72117217
req, _ := NewRequest("GET", cst.ts.URL, strings.NewReader("body"))
72127218
req.Header.Set("Expect", "100-continue")
@@ -7223,6 +7229,7 @@ func TestServerReadAfterHandlerAbort100Continue(t *testing.T) {
72237229
run(t, testServerReadAfterHandlerAbort100Continue)
72247230
}
72257231
func testServerReadAfterHandlerAbort100Continue(t *testing.T, mode testMode) {
7232+
t.Skip("https://go.dev/issue/67555")
72267233
readyc := make(chan struct{})
72277234
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
72287235
go func() {
@@ -7231,7 +7238,9 @@ func testServerReadAfterHandlerAbort100Continue(t *testing.T, mode testMode) {
72317238
<-readyc
72327239
}()
72337240
panic(ErrAbortHandler)
7234-
}))
7241+
}), func(tr *Transport) {
7242+
tr.ExpectContinueTimeout = 24 * time.Hour // forever
7243+
})
72357244

72367245
req, _ := NewRequest("GET", cst.ts.URL, strings.NewReader("body"))
72377246
req.Header.Set("Expect", "100-continue")

0 commit comments

Comments
 (0)