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"
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -73,13 +74,8 @@ func TestCleanExit(t *testing.T) {
|
|||||||
timer := time.NewTimer(5 * time.Second)
|
timer := time.NewTimer(5 * time.Second)
|
||||||
select {
|
select {
|
||||||
case ps := <-waitchan:
|
case ps := <-waitchan:
|
||||||
// Admittedly, this is weird.
|
stat := ps.Sys().(syscall.WaitStatus)
|
||||||
// There is/was a bug in Go that marked
|
if stat.Signaled() && strings.Contains(ps.String(), "exited") {
|
||||||
// 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") {
|
|
||||||
t.Fatal("Process has not exited")
|
t.Fatal("Process has not exited")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user