mirror of https://github.com/docker/compose.git
build: ensure file handles properly closed (#5298)
I've been running the test suite (`./internal/engine` in particular) with `-count X` a lot recently to catch timing-related test failures. After running enough times, the tests start failing due to too many open files, so I did an audit and found a few places where files or readers weren't always being closed.
This commit is contained in:
parent
ab84b6ac5b
commit
6fc0b6ff27
|
@ -181,10 +181,11 @@ func TestNewDirectoriesAreRecursivelyWatched(t *testing.T) {
|
|||
|
||||
// change something inside sub directory
|
||||
changeFilePath := filepath.Join(subPath, "change")
|
||||
_, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)
|
||||
file, err := os.OpenFile(changeFilePath, os.O_RDONLY|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_ = file.Close()
|
||||
f.assertEvents(subPath, changeFilePath)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue