Skip to content

Commit 05c3b20

Browse files
committed
test(config): try another approach to make tests less flaky
1 parent 0a81de5 commit 05c3b20

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

config/config_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,15 @@ func TestKoanfAdapter_Watch(t *gotesting.T) {
5252
assert.Equal(t, "baz", ka.String("foo"))
5353
ctx, cancel := context.WithCancel(context.Background())
5454
defer cancel()
55-
end := make(chan struct{})
5655
go func() {
5756
ka.watcher.Watch(ctx, func() error {
5857
assert.NoError(t, ka.Reload(), "reload should be successful")
59-
end <- struct{}{}
6058
return nil
6159
})
6260
}()
6361
time.Sleep(time.Second)
6462
ioutil.WriteFile(f.Name(), []byte("foo: bar"), 0644)
65-
<-end
63+
time.Sleep(time.Second)
6664
assert.Equal(
6765
t,
6866
"bar",

0 commit comments

Comments
 (0)