]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: disable flaky 100-continue tests
authorDamien Neil <dneil@google.com>
Tue, 21 May 2024 21:12:15 +0000 (14:12 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 21 May 2024 21:40:59 +0000 (21:40 +0000)
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>
src/net/http/serve_test.go

index f454dcdbed3525fba279ec22c784996b97bb756f..5014c24969e4d58781ec0796b210cd83c48e1242 100644 (file)
@@ -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")