diff --git a/main_test.go b/main_test.go index 4e590dc4eb08da3bd68d2eaada3980f7f46c5998..59bac70ffe2ae8a1616a24a410ade8cc4ebec187 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") }