summaryrefslogtreecommitdiff
path: root/tests/matrix/concurrency_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-01 10:28:33 +0200
committerJakob Unterwurzacher2021-09-01 10:28:33 +0200
commitcbf282861b450db3a475f77686e3658c95c2a5a0 (patch)
treebe955d83aa0a583786aa5be3ba27f910a35872f3 /tests/matrix/concurrency_test.go
parent7c2255be9027551a1df54b3cb58ea9493857d391 (diff)
tests/matrix: don't leak fds in TestConcurrentReadCreate
We leaked a file descriptor for each empty file we encountered.
Diffstat (limited to 'tests/matrix/concurrency_test.go')
-rw-r--r--tests/matrix/concurrency_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/matrix/concurrency_test.go b/tests/matrix/concurrency_test.go
index 04b7c96..d133c45 100644
--- a/tests/matrix/concurrency_test.go
+++ b/tests/matrix/concurrency_test.go
@@ -110,6 +110,7 @@ func TestConcurrentReadCreate(t *testing.T) {
continue
}
n, err := f.Read(buf0)
+ f.Close()
if err == io.EOF {
i++
continue
@@ -122,7 +123,6 @@ func TestConcurrentReadCreate(t *testing.T) {
// Calling t.Fatal() from a goroutine hangs the test so we use log.Fatal
log.Fatalf("%s: content mismatch: have=%q want=%q", t.Name(), string(buf), string(content))
}
- f.Close()
}
wg.Done()
}()