Skip to content

Commit

Permalink
Fix test flakes for TestWatchSemantics
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Jun 26, 2024
1 parent 44c1a0e commit 5081ba4
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 5081ba4

Please sign in to comment.