From 55a25aa6ca03143bef38be7f6d618df51c569a66 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 16 Dec 2021 12:32:39 -0500 Subject: [PATCH] net: lengthen arbitrary SetDeadline timeout by a few orders of magnitude MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The "someTimeout" constant in the net test is “just to test that net.Conn implementations don't explode when their SetFooDeadline methods are called”. It was set to 10 seconds, which is short enough that it could actually matter on some platforms. Since the point of the constant is just to make sure methods don't explode, we should set it to be at least a couple of orders of magnitude longer than the test: then it is guaranteed not to have any unintended side-effects. Fixes #50227 Change-Id: If97ae7bef5e7f16b336d09ccc37f5ea2ea7e70b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/372796 Trust: Bryan Mills Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/net/conn_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/conn_test.go b/src/net/conn_test.go index 3403eddfd3..d168dda08e 100644 --- a/src/net/conn_test.go +++ b/src/net/conn_test.go @@ -17,7 +17,7 @@ import ( // someTimeout is used just to test that net.Conn implementations // don't explode when their SetFooDeadline methods are called. // It isn't actually used for testing timeouts. -const someTimeout = 10 * time.Second +const someTimeout = 1 * time.Hour func TestConnAndListener(t *testing.T) { for i, network := range []string{"tcp", "unix", "unixpacket"} { -- 2.48.1