]> Cypherpunks repositories - gostls13.git/commit
cmd/go: terminate TestScript commands more aggressively when the test times out
authorBryan C. Mills <bcmills@google.com>
Wed, 13 May 2020 03:06:14 +0000 (23:06 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 14 May 2020 03:10:52 +0000 (03:10 +0000)
commite3ccf406231ece59975d999f18f37d1615112aaf
treeff658cc7ad273fe0e9da8ba82644be13d85a9ecb
parenta88c26eb286098b4c8f322f5076e933556fce5ac
cmd/go: terminate TestScript commands more aggressively when the test times out

- Avoid starting subprocesses when the test is already very close to
  timing out. The overhead of starting and stopping processes may
  cause the test to exceed its deadline even if each individual
  process is signaled soon after it is started.

- If a command does not shut down quickly enough after receiving
  os.Interrupt, send it os.Kill using the same style of grace period
  as in CL 228438.

- Fail the test if a background command whose exit status is not
  ignored is left running at the end of the test. We have no reliable
  way to distinguish a failure due to the termination signal from an
  unexpected failure, and the termination signal varies across
  platforms (so may cause failure on one platform but success on
  another).

For #38797

Change-Id: I767898cf551dca45579bf01a9d1bb312e12d6193
Reviewed-on: https://go-review.googlesource.com/c/go/+/233526
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/go_test.go
src/cmd/go/script_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/script_wait.txt