diff options
author | Bryan C. Mills <bcmills@google.com> | 2020-05-12 23:06:14 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2020-05-14 03:10:52 +0000 |
commit | e3ccf406231ece59975d999f18f37d1615112aaf (patch) | |
tree | ff658cc7ad273fe0e9da8ba82644be13d85a9ecb /src/cmd/go/testdata/script/README | |
parent | a88c26eb286098b4c8f322f5076e933556fce5ac (diff) | |
download | go-e3ccf406231ece59975d999f18f37d1615112aaf.tar.gz go-e3ccf406231ece59975d999f18f37d1615112aaf.zip |
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>
Diffstat (limited to 'src/cmd/go/testdata/script/README')
-rw-r--r-- | src/cmd/go/testdata/script/README | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README index e22ddcaf2e..c7fa7cfef5 100644 --- a/src/cmd/go/testdata/script/README +++ b/src/cmd/go/testdata/script/README @@ -138,8 +138,9 @@ The commands are: output and standard error of the previous command is cleared, but the output of the background process is buffered — and checking of its exit status is delayed — until the next call to 'wait', 'skip', or 'stop' or the end of the - test. At the end of the test, any remaining background processes are - terminated using os.Interrupt (if supported) or os.Kill. + test. If any background processes remain at the end of the test, they + are terminated using os.Interrupt (if supported) or os.Kill and the test + must not depend upon their exit status. - [!] exists [-readonly] [-exec] file... Each of the listed files or directories must (or must not) exist. |