diff options
author | Ian Lance Taylor <iant@golang.org> | 2017-02-21 07:14:51 -0800 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-03-25 03:59:40 +0000 |
commit | f8ed4539eb02e168aeeba891c38973336aa8e21c (patch) | |
tree | 90ba6d4da08324e2aee3a8cd8177fc49ec2c777c | |
parent | d43130743c4fab18f49d8f16fa5eec2346d3e060 (diff) | |
download | go-f8ed4539eb02e168aeeba891c38973336aa8e21c.tar.gz go-f8ed4539eb02e168aeeba891c38973336aa8e21c.zip |
[release-branch.go1.8] 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>
(cherry picked from commit 35ffca31b180e6f9da6035326132f048980dc58c)
Reviewed-on: https://go-review.googlesource.com/38607
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | src/os/exec/exec_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 34337450a0..bd20dd4955 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -262,9 +262,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 |