Skip to content

Commit

Permalink
Merge pull request #814 from jencull/stoneintg-924
Browse files Browse the repository at this point in the history
fix(stoneintg-924): intermittent unittest failure missing application…
  • Loading branch information
jencull authored Jul 23, 2024
2 parents ba31546 + e07b878 commit f53a4ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/controller/snapshot/snapshot_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ var _ = Describe("SnapshotController", func() {
hasSnapshot.Spec.Application = string("im-a-ghost")
Expect(k8sClient.Update(ctx, hasSnapshot)).Should(Succeed())

// Use Eventually to ensure the update has been applied
Eventually(func() bool {
err := k8sClient.Get(ctx, types.NamespacedName{
Namespace: hasSnapshot.Namespace,
Name: hasSnapshot.Name,
}, hasSnapshot)
return err == nil && hasSnapshot.Spec.Application == "im-a-ghost"
}, time.Second*20, time.Second*2).Should(BeTrue())

result, err := snapshotReconciler.Reconcile(ctx, req)
Expect(result).To(Equal(ctrl.Result{}))
Expect(err).To(BeNil())
Expand Down

0 comments on commit f53a4ba

Please sign in to comment.