mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-27 20:42:58 +00:00
storage/etcd: add TestWatchDispatchBookmarkEvents unit test
This commit is contained in:
parent
6058540f3d
commit
875b00137f
@ -312,7 +312,7 @@ func TestNamespaceScopedWatch(t *testing.T) {
|
||||
func TestWatchDispatchBookmarkEvents(t *testing.T) {
|
||||
ctx, cacher, terminate := testSetup(t)
|
||||
t.Cleanup(terminate)
|
||||
storagetesting.RunTestWatchDispatchBookmarkEvents(ctx, t, cacher)
|
||||
storagetesting.RunTestWatchDispatchBookmarkEvents(ctx, t, cacher, true)
|
||||
}
|
||||
|
||||
func TestWatchBookmarksWithCorrectResourceVersion(t *testing.T) {
|
||||
|
@ -104,6 +104,17 @@ func TestProgressNotify(t *testing.T) {
|
||||
storagetesting.RunOptionalTestProgressNotify(ctx, t, store)
|
||||
}
|
||||
|
||||
// TestWatchDispatchBookmarkEvents makes sure that
|
||||
// setting allowWatchBookmarks query param against
|
||||
// etcd implementation doesn't have any effect.
|
||||
func TestWatchDispatchBookmarkEvents(t *testing.T) {
|
||||
clusterConfig := testserver.NewTestConfig(t)
|
||||
clusterConfig.ExperimentalWatchProgressNotifyInterval = time.Second
|
||||
ctx, store, _ := testSetup(t, withClientConfig(clusterConfig))
|
||||
|
||||
storagetesting.RunTestWatchDispatchBookmarkEvents(ctx, t, store, false)
|
||||
}
|
||||
|
||||
func TestSendInitialEventsBackwardCompatibility(t *testing.T) {
|
||||
ctx, store, _ := testSetup(t)
|
||||
storagetesting.RunSendInitialEventsBackwardCompatibility(ctx, t, store)
|
||||
|
@ -1042,7 +1042,7 @@ func RunTestNamespaceScopedWatch(ctx context.Context, t *testing.T, store storag
|
||||
// TODO(#109831): ProgressNotify feature is effectively implementing the same
|
||||
//
|
||||
// functionality, so we should refactor this functionality to share the same input.
|
||||
func RunTestWatchDispatchBookmarkEvents(ctx context.Context, t *testing.T, store storage.Interface) {
|
||||
func RunTestWatchDispatchBookmarkEvents(ctx context.Context, t *testing.T, store storage.Interface, expectedWatchBookmarks bool) {
|
||||
key, storedObj := testPropagateStore(ctx, t, store, &example.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "test-ns"}})
|
||||
startRV := storedObj.ResourceVersion
|
||||
|
||||
@ -1061,7 +1061,7 @@ func RunTestWatchDispatchBookmarkEvents(ctx context.Context, t *testing.T, store
|
||||
{
|
||||
name: "allowWatchBookmarks=true",
|
||||
timeout: 3 * time.Second,
|
||||
expected: true,
|
||||
expected: expectedWatchBookmarks,
|
||||
allowWatchBookmarks: true,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user