Skip to content

Commit

Permalink
Merge pull request kubernetes#125733 from wojtek-t/test_watch_semanti…
Browse files Browse the repository at this point in the history
…cs_flake

Fix test flakes for TestWatchSemantics
  • Loading branch information
k8s-ci-robot committed Jun 26, 2024
2 parents 59d90eb + 5081ba4 commit c7e3163
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c7e3163

Please sign in to comment.