From 774870611c1d2b405d67eb73ade628ced5e0e994 Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Mon, 9 May 2022 08:22:04 -0700 Subject: [PATCH] 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 --- .../src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go index 9267722cf8a..01af44118a9 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher_test.go @@ -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) }