Skip to content

Commit

Permalink
test: wait for cache to refresh after PV creation in testDeleteRestor…
Browse files Browse the repository at this point in the history
…ingPV

Signed-off-by: Ryotaro Banno <[email protected]>
  • Loading branch information
ushitora-anqou committed Dec 10, 2024
1 parent 8e0a3e0 commit bbf286c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/controller/mantlerestore_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,12 @@ func (test *mantleRestoreControllerUnitTest) testDeleteRestoringPV() {
err := test.reconciler.createOrUpdateRestoringPV(ctx, restore, test.backup)
Expect(err).NotTo(HaveOccurred())

// Make sure the client cache stores the restoring PV.
Eventually(func(g Gomega) {
err = k8sClient.Get(ctx, client.ObjectKey{Name: test.reconciler.restoringPVName(restore)}, &pv)
g.Expect(err).NotTo(HaveOccurred())
}).Should(Succeed())

err = test.reconciler.deleteRestoringPV(ctx, restoreDifferent)
Expect(err).To(HaveOccurred())

Expand Down

0 comments on commit bbf286c

Please sign in to comment.