[go] net/http: remove arbitrary timeout in TestServerHijackGetsBackgroundByte_big

0 views
Skip to first unread message

Damien Neil (Gerrit)

unread,
Dec 7, 2021, 12:52:32 PM12/7/21
to Bryan Mills, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Ian Lance Taylor, Gopher Robot, Brad Fitzpatrick, golang-co...@googlegroups.com

Damien Neil submitted this change.

View Change


Approvals: Ian Lance Taylor: Looks good to me, approved Damien Neil: Looks good to me, approved Bryan Mills: Trusted; Run TryBots Gopher Robot: TryBots succeeded
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 <bcm...@google.com>
Run-TryBot: Bryan Mills <bcm...@google.com>
TryBot-Result: Gopher Robot <go...@golang.org>
Reviewed-by: Ian Lance Taylor <ia...@golang.org>
Reviewed-by: Damien Neil <dn...@google.com>
---
M src/net/http/serve_test.go
1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go
index 82c1a67..d46400e 100644
--- a/src/net/http/serve_test.go
+++ b/src/net/http/serve_test.go
@@ -5998,11 +5998,7 @@
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.

To view, visit change 369854. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ic6bbb1ef8df2c111b9888ba9903f58633e7cb95d
Gerrit-Change-Number: 369854
Gerrit-PatchSet: 2
Gerrit-Owner: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages