Skip to content

Commit 8ea5687

Browse files
committed
internal/lsp/regtest: remove arbitrary timeout for closing the editor
Following up on some post-submit feedback in CL 417583. Fixes golang/go#53819 Change-Id: Iebb1e6496ab1d6fde8961d8617d0b63e19c7033b Reviewed-on: https://go-review.googlesource.com/c/tools/+/419503 Reviewed-by: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent d01bb2f commit 8ea5687

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

internal/lsp/regtest/runner.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,11 @@ func (r *Runner) Run(t *testing.T, files string, test TestFunc, opts ...RunOptio
391391
// For tests that failed due to a timeout, don't fail to shutdown
392392
// because ctx is done.
393393
//
394-
// golang/go#53820: now that we await the completion of ongoing work in
395-
// shutdown, we must allow a significant amount of time for ongoing go
396-
// command invocations to exit.
397-
ctx, cancel := context.WithTimeout(xcontext.Detach(ctx), 30*time.Second)
398-
defer cancel()
399-
if err := env.Editor.Close(ctx); err != nil {
400-
pprof.Lookup("goroutine").WriteTo(os.Stderr, 1)
394+
// There is little point to setting an arbitrary timeout for closing
395+
// the editor: in general we want to clean up before proceeding to the
396+
// next test, and if there is a deadlock preventing closing it will
397+
// eventually be handled by the `go test` timeout.
398+
if err := env.Editor.Close(xcontext.Detach(ctx)); err != nil {
401399
t.Errorf("closing editor: %v", err)
402400
}
403401
}()

0 commit comments

Comments
 (0)