-
-
Notifications
You must be signed in to change notification settings - Fork 962
Closed
Labels
Description
Which operating system (GOOS) and version are you using?
macOS: 10.14.6
Please describe the issue that occurred.
The following test fails:
func TestOpenCloseQuickly(t *testing.T) {
name := tempMkFile(t, "")
for i := 0; i < 1000; i++ {
w := newWatcher(t)
err := w.Add(name)
if err != nil {
t.Fatal(err)
}
err = w.Close()
if err != nil {
t.Fatal(err)
}
}
}
with
=== RUN TestOpenCloseQuickly
TestOpenCloseQuickly: integration_test.go:51: failed to create test file: open /var/folders/bw/6hyp_vyj68v973qbhlbcvlcr0000gn/T/fsnotify232022216: too many open files
--- FAIL: TestOpenCloseQuickly (0.00s)
The problem is that w.Close() returns before reader goroutine closes the kqueue fd.