aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2023-07-11 10:08:48 -0400
committerGopher Robot <gobot@golang.org>2023-07-11 17:37:32 +0000
commitcb7a091d729eab75ccfdaeba5a0605f05addf422 (patch)
tree1b9e3e0a5e92b2920d82052a3c17c87c0a52fc58
parent651869716a449a1868f5a5333796ab47482d7c65 (diff)
downloadgo-cb7a091d729eab75ccfdaeba5a0605f05addf422.tar.gz
go-cb7a091d729eab75ccfdaeba5a0605f05addf422.zip
os/exec: ignore context.Canceled errors in TestConcurrentExec
We cancel the Context to unblock the test as soon as all of the "exit" processes have completed. If that happens to occur before all of the "hang" processes have started, the Start calls may fail with context.Canceled. Since those errors are possible in normal operation of the test, ignore them. Fixes #61277. Updates #61080. Change-Id: I20db083ec89ca88eb085ceb2892b9f87f83705ac Reviewed-on: https://go-review.googlesource.com/c/go/+/508755 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
-rw-r--r--src/os/exec/exec_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index d37fffd39d..473f92ba8e 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -1754,7 +1754,9 @@ func TestConcurrentExec(t *testing.T) {
ready.Wait()
if err := cmd.Start(); err != nil {
- t.Error(err)
+ if !errors.Is(err, context.Canceled) {
+ t.Error(err)
+ }
return
}