diff options
author | Jakob Unterwurzacher | 2018-03-06 21:22:01 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-03-06 21:28:09 +0100 |
commit | 98f735ff6e05ef71753f1c2fa60c30b195b02d3d (patch) | |
tree | cb6ae0655ad7cc64e0979e4e5d37baca3ebdfdca /tests/test_helpers/helpers.go | |
parent | 4732e33a9a39935ecc07dfb7e857cc05b6fc6045 (diff) |
tests: drop "-z" from fusermount to catch forgotten fds
macos does not have lazy unmount, so let's not use it
on linux either.
If the unmount fails, run "lsof" to find the open file.
Also fix the first bug we found this way.
Diffstat (limited to 'tests/test_helpers/helpers.go')
-rw-r--r-- | tests/test_helpers/helpers.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go index 3beb10b..0cb45d4 100644 --- a/tests/test_helpers/helpers.go +++ b/tests/test_helpers/helpers.go @@ -195,14 +195,18 @@ func MountOrFatal(t *testing.T, c string, p string, extraArgs ...string) { func UnmountPanic(dir string) { err := UnmountErr(dir) if err != nil { - fmt.Println(err) - panic(err) + fmt.Printf("UnmountPanic: %v. Running lsof %s\n", err, dir) + cmd := exec.Command("lsof", dir) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + cmd.Run() + panic("UnmountPanic: unmount failed: " + err.Error()) } } // UnmountErr tries to unmount "dir" and returns the resulting error. func UnmountErr(dir string) error { - cmd := exec.Command(UnmountScript, "-u", "-z", dir) + cmd := exec.Command(UnmountScript, "-u", dir) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr return cmd.Run() |