Assert Signaled() and proc string
This commit is contained in:
parent
9514744a82
commit
d4df4f2ebe
10
main_test.go
10
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")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user