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 <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Bryan C. Mills 2022-11-17 14:02:26 -05:00 committed by Bryan Mills
parent 434d569df7
commit 3d085f3fce
1 changed files with 5 additions and 5 deletions

View File

@ -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()