diff options
Diffstat (limited to 'libgo/go/exp/inotify/inotify_linux_test.go')
-rw-r--r-- | libgo/go/exp/inotify/inotify_linux_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libgo/go/exp/inotify/inotify_linux_test.go b/libgo/go/exp/inotify/inotify_linux_test.go index d035ec1..c2160fc 100644 --- a/libgo/go/exp/inotify/inotify_linux_test.go +++ b/libgo/go/exp/inotify/inotify_linux_test.go @@ -83,14 +83,15 @@ func TestInotifyClose(t *testing.T) { watcher, _ := NewWatcher() watcher.Close() - done := false + done := make(chan bool) go func() { watcher.Close() - done = true + done <- true }() - time.Sleep(50 * time.Millisecond) - if !done { + select { + case <-done: + case <-time.After(50 * time.Millisecond): t.Fatal("double Close() test failed: second Close() call didn't return") } |