From: Martin Tournoij Date: Wed, 21 Dec 2022 21:18:19 +0000 (+0100) Subject: Wait a bit longer in TestInotifyDeleteOpenFile() X-Git-Tag: v1.7.2~18 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=c6f5cfa163edb0f1bb78be3a77053ee14c48a3ce;p=fsnotify.git Wait a bit longer in TestInotifyDeleteOpenFile() Solves some intermittent test failures on my laptop. --- diff --git a/backend_inotify.go b/backend_inotify.go index d9cb3a0..654ee27 100644 --- a/backend_inotify.go +++ b/backend_inotify.go @@ -408,14 +408,11 @@ func (w *Watcher) readEvents() { if n < unix.SizeofInotifyEvent { var err error if n == 0 { - // If EOF is received. This should really never happen. - err = io.EOF + err = io.EOF // If EOF is received. This should really never happen. } else if n < 0 { - // If an error occurred while reading. - err = errno + err = errno // If an error occurred while reading. } else { - // Read was too short. - err = errors.New("notify: short read in readEvents()") + err = errors.New("notify: short read in readEvents()") // Read was too short. } if !w.sendError(err) { return diff --git a/backend_inotify_test.go b/backend_inotify_test.go index 6965ee1..65a45b9 100644 --- a/backend_inotify_test.go +++ b/backend_inotify_test.go @@ -93,7 +93,7 @@ func TestInotifyDeleteOpenFile(t *testing.T) { w.collect(t) rm(t, file) - eventSeparator() + waitForEvents() e := w.events(t) cmpEvents(t, tmp, e, newEvents(t, `chmod /file`))