From b0cd95be6096bb4ae1c38f2e0909c773599f6143 Mon Sep 17 00:00:00 2001 From: Nathan Youngman Date: Wed, 16 Dec 2015 21:41:17 -0700 Subject: [PATCH] inotify: fix race in test --- inotify_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inotify_test.go b/inotify_test.go index 4b5c4b1..31660f8 100644 --- a/inotify_test.go +++ b/inotify_test.go @@ -332,6 +332,8 @@ func TestInotifyInnerMapLength(t *testing.T) { _ = <-w.Events // consume Remove event <-time.After(50 * time.Millisecond) // wait IN_IGNORE propagated + w.mu.Lock() + defer w.mu.Unlock() if len(w.watches) != 0 { t.Fatalf("Expected watches len is 0, but got: %d, %v", len(w.watches), w.watches) } -- 2.50.1