go/internal/lsp/regtest
Robert Findley 10cb4353f9 internal/lsp/regtest: improvements for shared execution modes
Following up on CL 417587, make several improvements to the regtest
runner related to shared execution modes:

- guard lazily-allocated resources with sync.Once rather than a common
  mutex.
- for simplicity, always set Runner.goplsPath
- start the separate process server synchronously, to ensure that it is
  running before test execution
- cancel the separate process server when the test runner exits
- remove the testing.T argument from server constructors
- close the regtest runner in a deferred function

Tested manually via -enable_gopls_subprocess_tests.

Change-Id: Ide3972a94c129bcce554c10dd167df01c3040d31
Reviewed-on: https://go-review.googlesource.com/c/tools/+/419954
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-08-02 18:16:22 +00:00
..
doc.go gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
env.go internal/lsp/regtest: simplify, consolidate, and document settings 2022-07-12 16:56:46 +00:00
env_test.go internal/lsp/regtest: add a benchmark for didChange 2021-05-06 02:57:18 +00:00
expectation.go internal/lsp/cache: report a critical error when go.work is invalid 2022-07-27 18:59:40 +00:00
regtest.go internal/lsp/regtest: improvements for shared execution modes 2022-08-02 18:16:22 +00:00
runner.go internal/lsp/regtest: improvements for shared execution modes 2022-08-02 18:16:22 +00:00
wrappers.go internal/lsp/regtest: simplify, consolidate, and document settings 2022-07-12 16:56:46 +00:00