registry/memory: watcher bug fixes (#1740)

* registry/memory: watcher bugfixes

* registry/memory: fix nil watcher bug

* registry/memory: fix watcher test
This commit is contained in:
ben-toogood
2020-06-25 11:02:35 +01:00
committed by GitHub
parent 687a5e2e58
commit 51b4ab0abc
4 changed files with 39 additions and 32 deletions

View File

@@ -11,10 +11,15 @@ func TestWatcher(t *testing.T) {
id: "test",
res: make(chan *registry.Result),
exit: make(chan bool),
wo: registry.WatchOptions{
Domain: registry.WildcardDomain,
},
}
go func() {
w.res <- &registry.Result{}
w.res <- &registry.Result{
Service: &registry.Service{Name: "foo"},
}
}()
_, err := w.Next()