Skip to content

Commit 4f431d2

Browse files
committed
test(alluxio): strengthen reconcile assertion to err+RequeueAfter checks
When Dataset is absent, ReconcileInternal reaches the 'no dataset bound' branch which returns RequeueAfterInterval(5s) with nil error. Replace the weak panic-safety check with precise assertions: Expect(err).ToNot(HaveOccurred()) Expect(result.RequeueAfter).ToNot(BeZero()) Note: Gemini's suggestion used result.Requeue which would be wrong here; RequeueAfterInterval sets RequeueAfter, not Requeue. Signed-off-by: Harsh <harshmastic@gmail.com>
1 parent b400fcc commit 4f431d2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pkg/controllers/v1alpha1/alluxio/alluxio_runtime_controller_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ var _ = Describe("AlluxioRuntimeController", func() {
104104
Namespace: testNamespace,
105105
},
106106
}
107-
// Reconcile will proceed past getRuntime (runtime exists) and call
108-
// ReconcileInternal. We cannot assert on the internal result because
109-
// ReconcileInternal may fail on missing Dataset or other resources in
110-
// unit-test conditions. We only assert that the call does not panic.
111-
Expect(func() { r.Reconcile(context.TODO(), req) }).ToNot(Panic()) //nolint:errcheck
107+
// Reconcile proceeds past getRuntime, builds the engine, then hits the
108+
// "no dataset bound" branch which returns RequeueAfter(5s) with no error.
109+
result, err := r.Reconcile(context.TODO(), req)
110+
Expect(err).ToNot(HaveOccurred())
111+
Expect(result.RequeueAfter).ToNot(BeZero())
112112
})
113113
})
114114
})

0 commit comments

Comments
 (0)