proc_test: fix and remove skip-code of Detach tests on arm64

* fix TestKill test:
It will fail in Open /proc/pid/ sporadicly since there is no any sync between signal sended(tracee handled) and open /proc/%d/, especially in some weak arm64 cpu. Skip /proc check on arm64.
* remove skip-code of Detach tests.
This commit is contained in:
吴衡10223547 2019-11-27 15:39:17 +08:00 committed by Derek Parker
parent 6a9a8c9770
commit 23d080abe3

@ -154,9 +154,6 @@ func TestExit(t *testing.T) {
}
func TestExitAfterContinue(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("test is not valid on ARM64")
}
protest.AllowRecording(t)
withTestProcess("continuetestprog", t, func(p proc.Process, fixture protest.Fixture) {
setFunctionBreakpoint(p, t, "main.sayhi")
@ -984,9 +981,6 @@ func TestStacktraceGoroutine(t *testing.T) {
}
func TestKill(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("test is not valid on ARM64")
}
if testBackend == "lldb" {
// k command presumably works but leaves the process around?
return
@ -999,6 +993,10 @@ func TestKill(t *testing.T) {
t.Fatal("expected process to have exited")
}
if runtime.GOOS == "linux" {
if runtime.GOARCH == "arm64" {
//there is no any sync between signal sended(tracee handled) and open /proc/%d/. It may fail on arm64
return
}
_, err := os.Open(fmt.Sprintf("/proc/%d/", p.Pid()))
if err == nil {
t.Fatal("process has not exited", p.Pid())