From 3064d72b9774029ab89daea8a7fccfe181c3cae0 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 5 Mar 2018 21:56:30 +0100 Subject: 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' --- tests/matrix/matrix_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/matrix') 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) -- cgit v1.2.3