diff options
author | Jakob Unterwurzacher | 2018-04-01 14:51:07 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-04-01 14:51:07 +0200 |
commit | 6e637f38ffccd8be3d0e025aae53aeb382d99a08 (patch) | |
tree | 9e94a25509929cf280637e7d345716c3a59c3f77 /tests/matrix | |
parent | 8fcd39a3b08f956edc0939c87b089b4dbb60afd6 (diff) |
tests: add a few explicit file Close() in matrix_test
These can cause EBUSY errors when unmounting.
Diffstat (limited to 'tests/matrix')
-rw-r--r-- | tests/matrix/matrix_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go index 574f11f..37c7b20 100644 --- a/tests/matrix/matrix_test.go +++ b/tests/matrix/matrix_test.go @@ -146,6 +146,7 @@ func TestTruncate(t *testing.T) { if err != nil { t.FailNow() } + defer file.Close() // Grow to two blocks file.Truncate(7000) test_helpers.VerifySize(t, fn, 7000) @@ -230,6 +231,7 @@ func TestFallocate(t *testing.T) { if err != nil { t.FailNow() } + defer file.Close() wellKnown := isWellKnownFS(test_helpers.DefaultCipherDir) fd := int(file.Fd()) nBytes := test_helpers.Du(t, fd) @@ -333,7 +335,6 @@ func TestFallocate(t *testing.T) { } } // Cleanup - file.Close() syscall.Unlink(fn) if !wellKnown { // Even though most tests have been executed still, inform the user @@ -348,6 +349,7 @@ func TestAppend(t *testing.T) { if err != nil { t.FailNow() } + defer file.Close() data := []byte("testdata123456789") // length 17 var buf bytes.Buffer var hashWant string @@ -381,6 +383,7 @@ func TestFileHoles(t *testing.T) { if err != nil { t.Errorf("file create failed") } + defer file.Close() foo := []byte("foo") file.Write(foo) file.WriteAt(foo, 4096) |