From 3d085f3fce3726c1fa1dc82f8aac815b3ee3995f Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 17 Nov 2022 14:02:26 -0500 Subject: [PATCH] gopls/internal/lsp/lsprpc: eliminate arbitrary timeout in TestEnvForwarding Fixes golang/go#56804. Change-Id: I1df083bbc4f8c7a41d08ec85fceaa018d26b2f8b Reviewed-on: https://go-review.googlesource.com/c/tools/+/451599 Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot gopls-CI: kokoro Run-TryBot: Bryan Mills Reviewed-by: Robert Findley --- gopls/internal/lsp/lsprpc/lsprpc_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gopls/internal/lsp/lsprpc/lsprpc_test.go b/gopls/internal/lsp/lsprpc/lsprpc_test.go index 5718dfec1f..1bf20b521c 100644 --- a/gopls/internal/lsp/lsprpc/lsprpc_test.go +++ b/gopls/internal/lsp/lsprpc/lsprpc_test.go @@ -12,13 +12,13 @@ import ( "testing" "time" - "golang.org/x/tools/internal/event" - "golang.org/x/tools/internal/jsonrpc2" - "golang.org/x/tools/internal/jsonrpc2/servertest" "golang.org/x/tools/gopls/internal/lsp/cache" "golang.org/x/tools/gopls/internal/lsp/debug" "golang.org/x/tools/gopls/internal/lsp/fake" "golang.org/x/tools/gopls/internal/lsp/protocol" + "golang.org/x/tools/internal/event" + "golang.org/x/tools/internal/jsonrpc2" + "golang.org/x/tools/internal/jsonrpc2/servertest" "golang.org/x/tools/internal/testenv" ) @@ -290,9 +290,9 @@ func (s *initServer) Initialize(ctx context.Context, params *protocol.ParamIniti func TestEnvForwarding(t *testing.T) { testenv.NeedsGo1Point(t, 13) + ctx := context.Background() + server := &initServer{} - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - defer cancel() _, tsForwarded, cleanup := setupForwarding(ctx, t, server) defer cleanup()