From d4df4f2ebe2a87f63713ad060509cb6e7b8f1c9b Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Tue, 26 Aug 2014 08:23:24 -0500 Subject: [PATCH] Assert Signaled() and proc string --- main_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main_test.go b/main_test.go index 4e590dc4..59bac70f 100644 --- a/main_test.go +++ b/main_test.go @@ -6,6 +6,7 @@ import ( "os/exec" "strconv" "strings" + "syscall" "testing" "time" ) @@ -73,13 +74,8 @@ func TestCleanExit(t *testing.T) { timer := time.NewTimer(5 * time.Second) select { case ps := <-waitchan: - // Admittedly, this is weird. - // There is/was a bug in Go that marked - // a process as done whenever `Wait()` was - // called on it, I fixed that, but it seems - // there may be another connected bug somewhere - // where the process is not marked as exited. - if strings.Contains(ps.String(), "exited") { + stat := ps.Sys().(syscall.WaitStatus) + if stat.Signaled() && strings.Contains(ps.String(), "exited") { t.Fatal("Process has not exited") } -- GitLab