summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-19 16:41:25 +0300
committerValery Piashchynski <[email protected]>2020-12-19 16:41:25 +0300
commit104513f4c57a647ca91cd23adfdf4d080eea034a (patch)
treef0aee3603517a2ae64256e76dcd1e6e2fc1cc5f2
parent31c74fa9454b9060ec9bf089d7dc288d227219cf (diff)
Add time to concurrent run on 2 gorountines
-rw-r--r--service/reload/watcher_test.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/service/reload/watcher_test.go b/service/reload/watcher_test.go
index 9eaed3ec..e3a284d9 100644
--- a/service/reload/watcher_test.go
+++ b/service/reload/watcher_test.go
@@ -209,13 +209,10 @@ func Test_FileExtensionFilter(t *testing.T) {
go func() {
go func() {
- err2 := ioutil.WriteFile(filepath.Join(tempDir, "file3.txt"),
+ time.Sleep(time.Second)
+ err := ioutil.WriteFile(filepath.Join(tempDir, "file3.txt"),
[]byte{1, 1, 1}, 0755)
- if err2 != nil {
- panic(err2)
- }
-
- runtime.Goexit()
+ assert.NoError(t, err)
}()
go func() {
@@ -224,8 +221,8 @@ func Test_FileExtensionFilter(t *testing.T) {
panic("handled event from filtered file")
}
}()
+ time.Sleep(time.Second)
w.Stop()
- runtime.Goexit()
}()
err = w.StartPolling(time.Second)