aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/matrix/matrix_test.go1
-rw-r--r--tests/test_helpers/helpers.go10
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index f492001..574f11f 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -796,6 +796,7 @@ func TestUtimesNanoFd(t *testing.T) {
if err != nil {
t.Fatal(err)
}
+ defer f.Close()
procPath := fmt.Sprintf("/proc/self/fd/%d", f.Fd())
doTestUtimesNano(t, procPath)
}
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()