Skip to content

Commit

Permalink
fix flaky TestPatchHelper tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer [email protected]
  • Loading branch information
sbueringer committed Sep 7, 2021
1 parent 2798730 commit efe4335
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/patch/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ func TestPatchHelper(t *testing.T) {
readyBefore := conditions.Get(obj, clusterv1.ReadyCondition)
readyAfter := conditions.Get(objAfter, clusterv1.ReadyCondition)

// Differences in the LastTransitionTime are intentionally ignored as the LastTransitionTime is re-calculated
// in conditions.Set during patch.Helper.Patch() and thus not necessarily equal to the one in the original obj.
readyBefore.LastTransitionTime = readyAfter.LastTransitionTime

return cmp.Equal(readyBefore, readyAfter)
}, timeout).Should(BeTrue())
})
Expand Down Expand Up @@ -476,6 +480,10 @@ func TestPatchHelper(t *testing.T) {
readyBefore := conditions.Get(obj, clusterv1.ReadyCondition)
readyAfter := conditions.Get(objAfter, clusterv1.ReadyCondition)

// Differences in the LastTransitionTime are intentionally ignored as the LastTransitionTime is re-calculated
// in conditions.Set during patch.Helper.Patch() and thus not necessarily equal to the one in the original obj.
readyBefore.LastTransitionTime = readyAfter.LastTransitionTime

return cmp.Equal(readyBefore, readyAfter)
}, timeout).Should(BeTrue())
})
Expand Down

0 comments on commit efe4335

Please sign in to comment.