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 01af44118a9..c3503b5255a 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 @@ -137,6 +137,10 @@ func TestWatchError(t *testing.T) { func TestWatchContextCancel(t *testing.T) { ctx, store, _ := testSetup(t) + RunTestWatchContextCancel(ctx, t, store) +} + +func RunTestWatchContextCancel(ctx context.Context, t *testing.T, store storage.Interface) { canceledCtx, cancel := context.WithCancel(ctx) cancel() // When we watch with a canceled context, we should detect that it's context canceled.