Skip to content

Commit cb7a091

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
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 <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 6518697 commit cb7a091

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/os/exec/exec_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,9 @@ func TestConcurrentExec(t *testing.T) {
17541754

17551755
ready.Wait()
17561756
if err := cmd.Start(); err != nil {
1757-
t.Error(err)
1757+
if !errors.Is(err, context.Canceled) {
1758+
t.Error(err)
1759+
}
17581760
return
17591761
}
17601762

0 commit comments

Comments
 (0)