summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-19 17:43:36 +0300
committerValery Piashchynski <[email protected]>2020-12-19 17:43:36 +0300
commita73279446750b753255375226f53e9cc10478066 (patch)
treedbb4359e106c72629429548f13227d0115bb9e76
parentace5f47196e0a5d0e926f5a956cd89574083c19a (diff)
Correct Test_FileExtensionFilter test
-rw-r--r--service/reload/watcher_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/service/reload/watcher_test.go b/service/reload/watcher_test.go
index c0b8da6b..4507bdcd 100644
--- a/service/reload/watcher_test.go
+++ b/service/reload/watcher_test.go
@@ -208,17 +208,21 @@ func Test_FileExtensionFilter(t *testing.T) {
go limitTime(time.Second*10, t.Name(), c)
go func() {
+ stop := make(chan struct{}, 1)
go func() {
time.Sleep(time.Second)
err := ioutil.WriteFile(filepath.Join(tempDir, "file3.txt"),
[]byte{1, 1, 1}, 0755)
assert.NoError(t, err)
+ stop <- struct{}{}
}()
go func() {
- for e := range w.Event {
- fmt.Println(e.Info.Name())
+ select {
+ case <-w.Event:
panic("handled event from filtered file")
+ case <-stop:
+ return
}
}()
time.Sleep(time.Second)