Skip to content

Commit

Permalink
UT fix for vshandler-test
Browse files Browse the repository at this point in the history
With this command, the test would fail without the fix:
cmd: # ginkgo -focus="When no running pod is mounting the PVC to be protected" -repeat=10

With this fix the result is consistently succeeding.
Here is the result of 100 attempts:

Ran 1 of 56 Specs in 12.390 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 55 Skipped
PASS

All tests passed...
This was attempt 100 of 101.
Running Suite: Volsync Suite - /root/DR/ut-fix/ramen/internal/controller/volsync
================================================================================
Random Seed: 1739983377

Will run 1 of 56 specs
SSSSSSS•SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Ran 1 of 56 Specs in 11.616 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 55 Skipped
PASS

Ginkgo ran 1 suite in 19m32.890356929s
Test Suite Passed

Signed-off-by: pruthvitd <[email protected]>
  • Loading branch information
pruthvitd authored and nirs committed Feb 19, 2025
1 parent 6529e69 commit ef0ed73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/controller/volsync/vshandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,13 @@ var _ = Describe("VolSync_Handler", func() {
Expect(finalSyncCompl).To(BeFalse())
Expect(rs).ToNot(BeNil())

// ReconcileRS should have created the replication source - since the secret isn't there
// Ensure replication source is created
Eventually(func() error {
return k8sClient.Get(ctx,
types.NamespacedName{Name: rsSpec.ProtectedPVC.Name, Namespace: testNamespace.GetName()}, createdRS)
}, maxWait, interval).Should(Succeed())

// Consistently continue to synchronize PVC data to a remote location
Consistently(func() error {
return k8sClient.Get(ctx,
types.NamespacedName{Name: rsSpec.ProtectedPVC.Name, Namespace: testNamespace.GetName()}, createdRS)
Expand Down

0 comments on commit ef0ed73

Please sign in to comment.