I think the value returned from the :fallback on with-retry is not used. I can reproduce this by modifying the fallback test.
(deftest fallback
;; This is the original test
(testing "fallback value is same as original value"
(is (= 10 (dh/with-retry {:fallback (fn [v e]
(is (= v 10))
(is (nil? e))
v)
:retry-if (fn [v e] (< v 10))}
dh/*executions*)))
;; Here I changed fallback to instead return :fail.
(testing "fallback value is different from original value"
(is (= :fail (dh/with-retry {:fallback (fn [v e]
(is (= v 10))
(is (nil? e))
:fail)
:retry-if (fn [v e] (< v 10))}
dh/*executions*))))))
1 non-passing tests:
Fail in fallback
fallback value is same as original value fallback value is different from original value
expected: :fail
actual: 10
diff: - :fail
+ 10
I think the value returned from the
:fallback
onwith-retry
is not used. I can reproduce this by modifying the fallback test.Here's a simpler test that also fails:
I'm not sure
:fallback
is even running though: