From f9b15700fb5a99ab74d51c7779ea2aae0f51168c Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Thu, 27 Jun 2024 11:01:37 +0200 Subject: [PATCH] apiserver/storage: storagetesting.RunTestList validates RemainingItemCount --- .../src/k8s.io/apiserver/pkg/storage/testing/store_tests.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go b/staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go index 69364e385da..73667abc7c1 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go @@ -28,6 +28,7 @@ import ( "sync" "testing" + "github.com/google/go-cmp/cmp" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" @@ -1246,6 +1247,9 @@ func RunTestList(ctx context.Context, t *testing.T, store storage.Interface, com } else { ExpectContains(t, "incorrect list pods", toInterfaceSlice(tt.expectedAlternatives), out.Items) } + if !cmp.Equal(tt.expectedRemainingItemCount, out.RemainingItemCount) { + t.Fatalf("unexpected remainingItemCount, diff: %s", cmp.Diff(tt.expectedRemainingItemCount, out.RemainingItemCount)) + } }) } }