From 7164fad87a3be06220771f2ae497cb15ef467e31 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Tue, 21 May 2024 14:12:15 -0700 Subject: [PATCH] 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 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov --- src/net/http/serve_test.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index f454dcdbed..5014c24969 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -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")