aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-02-21 07:14:51 -0800
committerIan Lance Taylor <iant@golang.org>2017-02-21 17:12:57 +0000
commit35ffca31b180e6f9da6035326132f048980dc58c (patch)
treefa0086455e357dba087171cb297bf22eddefcff5 /src/os/exec/exec_test.go
parenta355639c6046edae6b3a5190bc78260c2fe3b063 (diff)
downloadgo-35ffca31b180e6f9da6035326132f048980dc58c.tar.gz
go-35ffca31b180e6f9da6035326132f048980dc58c.zip
os/exec: deflake TestStdinCloseRace
Stop reporting errors from cmd.Process.Kill; they don't matter for purposes of this test, and they can occur if the process exits quickly. Fixes #19211. Fixes #19213. Change-Id: I1a0bb9170220ca69199abb8e8811b1dde43e1897 Reviewed-on: https://go-review.googlesource.com/37309 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/os/exec/exec_test.go')
-rw-r--r--src/os/exec/exec_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index 1a159e261f..5b8627db54 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -263,9 +263,13 @@ func TestStdinCloseRace(t *testing.T) {
t.Fatalf("Start: %v", err)
}
go func() {
- if err := cmd.Process.Kill(); err != nil {
- t.Errorf("Kill: %v", err)
- }
+ // We don't check the error return of Kill. It is
+ // possible that the process has already exited, in
+ // which case Kill will return an error "process
+ // already finished". The purpose of this test is to
+ // see whether the race detector reports an error; it
+ // doesn't matter whether this Kill succeeds or not.
+ cmd.Process.Kill()
}()
go func() {
// Send the wrong string, so that the child fails even