]> Cypherpunks.ru repositories - gostls13.git/commitdiff
os/exec: ignore context.Canceled errors in TestConcurrentExec
authorBryan C. Mills <bcmills@google.com>
Tue, 11 Jul 2023 14:08:48 +0000 (10:08 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 11 Jul 2023 17:37:32 +0000 (17:37 +0000)
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>
src/os/exec/exec_test.go

index d37fffd39d32e6708faf7c3a06ca1e21a427e8d0..473f92ba8e43a14c91823170d4b96a2076960ee8 100644 (file)
@@ -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
                        }