From e5ba7d3abf1e356f8cb7d760f95a389dd08c63ae Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 6 Dec 2021 22:09:12 -0500 Subject: [PATCH] net/http: remove arbitrary timeout in TestServerHijackGetsBackgroundByte_big This test fails with "timeout" once per couple of months. It may be that the arbitrary timeout is too short, or it may be that the test is detecting a real bug (perhaps a deadlock) and reporting it without sufficient information to debug. Either way, the arbitrary timeout is doing only harm: either it is too short, or it is preventing us from getting a useful goroutine dump when the test inevitably times out. Fixes #35498 (hopefully). Change-Id: Ic6bbb1ef8df2c111b9888ba9903f58633e7cb95d Reviewed-on: https://go-review.googlesource.com/c/go/+/369854 Trust: Bryan Mills Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Reviewed-by: Damien Neil --- src/net/http/serve_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 82c1a6716f8..d46400ef75a 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -5998,11 +5998,7 @@ func TestServerHijackGetsBackgroundByte_big(t *testing.T) { t.Fatal(err) } - select { - case <-done: - case <-time.After(2 * time.Second): - t.Error("timeout") - } + <-done } // Issue 18319: test that the Server validates the request method.