diff --git a/tail_test.go b/tail_test.go index 8dcc02c..e29da4b 100644 --- a/tail_test.go +++ b/tail_test.go @@ -343,7 +343,7 @@ func reOpen(t *testing.T, poll bool) { "test.txt", Config{Follow: true, ReOpen: true, Poll: poll}) content := []string{"hello", "world", "more", "data", "endofworld"} - go tailTest.ReadLines(tail, content) + go tailTest.VerifyTailOutput(tail, content, false) // deletion must trigger reopen <-time.After(delay) @@ -366,7 +366,7 @@ func reOpen(t *testing.T, poll bool) { // Do not bother with stopping as it could kill the tomb during // the reading of data written above. Timings can vary based on // test environment. - tail.Cleanup() + tailTest.Cleanup(tail, false) } func reSeek(t *testing.T, poll bool) { diff --git a/watch/inotify_tracker.go b/watch/inotify_tracker.go index 4f85217..a742cd5 100644 --- a/watch/inotify_tracker.go +++ b/watch/inotify_tracker.go @@ -155,6 +155,8 @@ func (shared *InotifyTracker) addWatch(winfo *watchInfo) error { if shared.chans[winfo.fname] == nil { shared.chans[winfo.fname] = make(chan fsnotify.Event) + } + if shared.done[winfo.fname] == nil { shared.done[winfo.fname] = make(chan bool) }