summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-05-09 19:03:16 +0200
committerJakob Unterwurzacher2020-05-09 19:03:16 +0200
commitf0184804f4e9f878c560648cc9b773f84d6a2c53 (patch)
tree94676b0d5dcb40d589232e5a34e846785f9da896 /tests
parent16221facb9066ccf03015ccfe9e7ca784b0d2099 (diff)
test_helper: kill lsof after 1 second
lsof may get stuck when gocryptfs itself is stuck.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_helpers/mount_unmount.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_helpers/mount_unmount.go b/tests/test_helpers/mount_unmount.go
index 7b5dafa..753ae1a 100644
--- a/tests/test_helpers/mount_unmount.go
+++ b/tests/test_helpers/mount_unmount.go
@@ -126,7 +126,13 @@ func UnmountPanic(dir string) {
cmd := exec.Command("lsof", dir)
cmd.Stdout = os.Stdout
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())
}
}