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

Assert Signaled() and proc string

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