From c6f5cfa163edb0f1bb78be3a77053ee14c48a3ce Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 21 Dec 2022 22:18:19 +0100 Subject: [PATCH] Wait a bit longer in TestInotifyDeleteOpenFile() Solves some intermittent test failures on my laptop. --- backend_inotify.go | 9 +++------ backend_inotify_test.go | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) 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`)) -- 2.50.1