go/internal/testenv
Bryan C. Mills 932ec22a59 internal/testenv: add a Command function that replaces exec.Command
The function is derived from the testenv.Command function in the main
repo as of CL 446875, with a couple of modifications to allow it to
build (with more limited functionality) with Go versions as old as
1.16 (currently needed in order to test gopls with such versions).

testenv.Command sets up an exec.Cmd with more useful termination
behavior in the context of a test: namely, it is terminated with
SIGQUIT (to get a goroutine dump from the subprocess) shortly before
the test would otherwise time out.

Assuming that the test logs the output from the command appropriately,
this should make deadlocks and unexpectedly slow operations easier to
diagnose in the builders.

For golang/go#50014.
Updates golang/go#50436.

Change-Id: I872d4b24e63951bf9b7811189e672973d366fb78
Reviewed-on: https://go-review.googlesource.com/c/tools/+/377835
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-11-21 16:54:26 +00:00
..
exec.go internal/testenv: add a Command function that replaces exec.Command 2022-11-21 16:54:26 +00:00
testenv.go internal/testenv: add a Command function that replaces exec.Command 2022-11-21 16:54:26 +00:00
testenv_notunix.go internal/testenv: add a Command function that replaces exec.Command 2022-11-21 16:54:26 +00:00
testenv_unix.go internal/testenv: add a Command function that replaces exec.Command 2022-11-21 16:54:26 +00:00