From 58b911dc71a51cdaaff8022f54ed81ab02e24131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Wed, 26 Jun 2024 17:49:54 +0200 Subject: [PATCH] Fix test flakes for TestWatchSemantics Kubernetes-commit: 5081ba45f9ed84784a250338ee6d96b485ff4e4a --- pkg/storage/testing/watcher_tests.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/storage/testing/watcher_tests.go b/pkg/storage/testing/watcher_tests.go index 3fdb17a09..dee88a0e6 100644 --- a/pkg/storage/testing/watcher_tests.go +++ b/pkg/storage/testing/watcher_tests.go @@ -1486,11 +1486,15 @@ func RunWatchSemantics(ctx context.Context, t *testing.T, store storage.Interfac expectedBookmarkEventWithMinRV := scenario.expectedInitialEventsBookmarkWithMinimalRV(createdPods) expectedObj, err := meta.Accessor(expectedBookmarkEventWithMinRV.Object) require.NoError(t, err) + expectedRV, err := storage.APIObjectVersioner{}.ObjectResourceVersion(expectedBookmarkEventWithMinRV.Object) + require.NoError(t, err) actualObj, err := meta.Accessor(actualEvent.Object) require.NoError(t, err) + actualRV, err := storage.APIObjectVersioner{}.ObjectResourceVersion(actualEvent.Object) + require.NoError(t, err) - require.GreaterOrEqual(t, actualObj.GetResourceVersion(), expectedObj.GetResourceVersion()) + require.GreaterOrEqual(t, actualRV, expectedRV) // once we know that the RV is at least >= the expected one // rewrite it so that we can compare the objs