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

Fix potential suite hang

上级 eae4e99f
...@@ -214,29 +214,31 @@ func TestNext(t *testing.T) { ...@@ -214,29 +214,31 @@ func TestNext(t *testing.T) {
// make sure here that after next'ing a couple time, we can // make sure here that after next'ing a couple time, we can
// still continue to execute the program without hitting a // still continue to execute the program without hitting a
// rogue breakpoint. // rogue breakpoint.
timer := time.NewTimer(5 * time.Second)
exited := make(chan interface{}) exited := make(chan interface{})
_, err = p.Clear(bp.Addr) _, err = p.Clear(bp.Addr)
assertNoError(err, t, "Clear()") assertNoError(err, t, "Clear()")
go func() { go func() {
_, err := syscall.Wait4(p.Pid, nil, 0, nil) fmt.Println("waiting")
if err != nil && err != syscall.ECHILD { select {
fmt.Println(err) case <-time.After(2 * time.Second):
syscall.PtraceDetach(p.Pid)
p.Process.Kill()
os.Exit(1) os.Exit(1)
case <-exited:
p.Process.Kill()
os.Exit(0)
} }
exited <- nil
}() }()
go func() { go func() {
select { _, err := syscall.Wait4(p.Pid, nil, 0, nil)
case <-timer.C: if err != nil && err != syscall.ECHILD {
p.Process.Kill() fmt.Println(err)
os.Exit(1) os.Exit(1)
case <-exited:
return
} }
exited <- nil
}() }()
// We must call Continue outside of the goroutine // We must call Continue outside of the goroutine
......
文件已添加
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册