etcd3/store: update cancelled watch test to be generic

There's no reason to create the watch using the underlying watcher.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
This commit is contained in:
Steve Kuznetsov 2022-05-09 08:22:04 -07:00
parent 543893cbb0
commit 774870611c
No known key found for this signature in database
GPG Key ID: 8821C29EC988D9B4

View File

@ -141,7 +141,10 @@ func TestWatchContextCancel(t *testing.T) {
cancel()
// When we watch with a canceled context, we should detect that it's context canceled.
// We won't take it as error and also close the watcher.
w, err := store.watcher.Watch(canceledCtx, "/abc", 0, false, false, storage.Everything)
w, err := store.Watch(canceledCtx, "/abc", storage.ListOptions{
ResourceVersion: "0",
Predicate: storage.Everything,
})
if err != nil {
t.Fatal(err)
}