提交 d4df4f2e 编写于 作者: D Derek Parker

Assert Signaled() and proc string

上级 9514744a
......@@ -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")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册