mirror of
https://github.com/golang/go
synced 2024-11-15 00:20:30 -07:00
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 <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
parent
5a9dabc2ba
commit
7164fad87a
@ -7171,13 +7171,16 @@ func TestServerReadAfterWriteHeader100Continue(t *testing.T) {
|
||||
run(t, testServerReadAfterWriteHeader100Continue)
|
||||
}
|
||||
func testServerReadAfterWriteHeader100Continue(t *testing.T, mode testMode) {
|
||||
t.Skip("https://go.dev/issue/67555")
|
||||
body := []byte("body")
|
||||
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
|
||||
w.WriteHeader(200)
|
||||
NewResponseController(w).Flush()
|
||||
io.ReadAll(r.Body)
|
||||
w.Write(body)
|
||||
}))
|
||||
}), func(tr *Transport) {
|
||||
tr.ExpectContinueTimeout = 24 * time.Hour // forever
|
||||
})
|
||||
|
||||
req, _ := NewRequest("GET", cst.ts.URL, strings.NewReader("body"))
|
||||
req.Header.Set("Expect", "100-continue")
|
||||
@ -7199,6 +7202,7 @@ func TestServerReadAfterHandlerDone100Continue(t *testing.T) {
|
||||
run(t, testServerReadAfterHandlerDone100Continue)
|
||||
}
|
||||
func testServerReadAfterHandlerDone100Continue(t *testing.T, mode testMode) {
|
||||
t.Skip("https://go.dev/issue/67555")
|
||||
readyc := make(chan struct{})
|
||||
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
|
||||
go func() {
|
||||
@ -7206,7 +7210,9 @@ func testServerReadAfterHandlerDone100Continue(t *testing.T, mode testMode) {
|
||||
io.ReadAll(r.Body)
|
||||
<-readyc
|
||||
}()
|
||||
}))
|
||||
}), func(tr *Transport) {
|
||||
tr.ExpectContinueTimeout = 24 * time.Hour // forever
|
||||
})
|
||||
|
||||
req, _ := NewRequest("GET", cst.ts.URL, strings.NewReader("body"))
|
||||
req.Header.Set("Expect", "100-continue")
|
||||
@ -7223,6 +7229,7 @@ func TestServerReadAfterHandlerAbort100Continue(t *testing.T) {
|
||||
run(t, testServerReadAfterHandlerAbort100Continue)
|
||||
}
|
||||
func testServerReadAfterHandlerAbort100Continue(t *testing.T, mode testMode) {
|
||||
t.Skip("https://go.dev/issue/67555")
|
||||
readyc := make(chan struct{})
|
||||
cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
|
||||
go func() {
|
||||
@ -7231,7 +7238,9 @@ func testServerReadAfterHandlerAbort100Continue(t *testing.T, mode testMode) {
|
||||
<-readyc
|
||||
}()
|
||||
panic(ErrAbortHandler)
|
||||
}))
|
||||
}), func(tr *Transport) {
|
||||
tr.ExpectContinueTimeout = 24 * time.Hour // forever
|
||||
})
|
||||
|
||||
req, _ := NewRequest("GET", cst.ts.URL, strings.NewReader("body"))
|
||||
req.Header.Set("Expect", "100-continue")
|
||||
|
Loading…
Reference in New Issue
Block a user