test_helper: kill lsof after 1 second
lsof may get stuck when gocryptfs itself is stuck.
This commit is contained in:
parent
16221facb9
commit
f0184804f4
@ -126,7 +126,13 @@ func UnmountPanic(dir string) {
|
|||||||
cmd := exec.Command("lsof", dir)
|
cmd := exec.Command("lsof", dir)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
cmd.Run()
|
cmd.Start()
|
||||||
|
timer := time.AfterFunc(1*time.Second, func() {
|
||||||
|
fmt.Printf("timeout!")
|
||||||
|
cmd.Process.Kill()
|
||||||
|
})
|
||||||
|
cmd.Wait()
|
||||||
|
timer.Stop()
|
||||||
panic("UnmountPanic: unmount failed: " + err.Error())
|
panic("UnmountPanic: unmount failed: " + err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user