tests/matrix: don't leak fds in TestConcurrentReadCreate
We leaked a file descriptor for each empty file we encountered.
This commit is contained in:
parent
7c2255be90
commit
cbf282861b
|
@ -110,6 +110,7 @@ func TestConcurrentReadCreate(t *testing.T) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
n, err := f.Read(buf0)
|
n, err := f.Read(buf0)
|
||||||
|
f.Close()
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
i++
|
i++
|
||||||
continue
|
continue
|
||||||
|
@ -122,7 +123,6 @@ func TestConcurrentReadCreate(t *testing.T) {
|
||||||
// Calling t.Fatal() from a goroutine hangs the test so we use log.Fatal
|
// 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))
|
log.Fatalf("%s: content mismatch: have=%q want=%q", t.Name(), string(buf), string(content))
|
||||||
}
|
}
|
||||||
f.Close()
|
|
||||||
}
|
}
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in New Issue