aboutsummaryrefslogtreecommitdiff
path: root/tests/matrix
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-03-05 21:56:30 +0100
committerJakob Unterwurzacher2018-03-05 22:00:59 +0100
commit3064d72b9774029ab89daea8a7fccfe181c3cae0 (patch)
tree288ba273f99c980a8c512cda438efe7a3c2bd694 /tests/matrix
parent6c172dcb02c32b9ed3b21e89367fd9826a880bc9 (diff)
tests: fix a few fd leaks
We relied on the finalizer to close a few fds. For some reason, this did not cause problems on Linux, but on MacOS, it causes unmount failures: umount(/private/tmp/gocryptfs-test-parent/194654785/default-plain): Resource busy -- try 'diskutil unmount'
Diffstat (limited to 'tests/matrix')
-rw-r--r--tests/matrix/matrix_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index d0ad0d5..d52c3f8 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -405,10 +405,12 @@ func TestRmwRace(t *testing.T) {
if err != nil {
t.Fatalf("file create failed")
}
+ defer f1.Close()
f2, err := os.Create(fn)
if err != nil {
t.Fatalf("file create failed")
}
+ defer f2.Close()
oldBlock := bytes.Repeat([]byte("o"), 4096)