From dec8f46b91552199ab40aafd9818729212e7cc9e Mon Sep 17 00:00:00 2001 From: Mitsunori Komatsu Date: Tue, 29 Oct 2024 11:03:22 +0900 Subject: [PATCH] Use the constants in core_test.cli --- scalardb/test/scalardb/core_test.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scalardb/test/scalardb/core_test.clj b/scalardb/test/scalardb/core_test.clj index 0bccaec..1ee27b2 100644 --- a/scalardb/test/scalardb/core_test.clj +++ b/scalardb/test/scalardb/core_test.clj @@ -103,7 +103,7 @@ scalar/create-service-instance (spy/stub nil)] (let [test {:db mock-db :storage (atom nil)}] (scalar/prepare-storage-service! test) - (is (spy/called-n-times? scalar/exponential-backoff 20)) + (is (spy/called-n-times? scalar/exponential-backoff scalardb.core/RETRIES)) (is (nil? @(:storage test)))))) (deftest check-connection-test @@ -150,8 +150,9 @@ (let [test {:storage (atom mock-storage)}] (is (thrown? clojure.lang.ExceptionInfo (scalar/check-transaction-states test #{"tx"}))) - (is (spy/called-n-times? scalar/exponential-backoff 20)) - (is (spy/called-n-times? scalar/prepare-storage-service! 7))))) + (is (spy/called-n-times? scalar/exponential-backoff scalardb.core/RETRIES)) + (is (spy/called-n-times? scalar/prepare-storage-service! + (+ (quot scalar/RETRIES scalar/RETRIES_FOR_RECONNECTION) 1)))))) (deftest compute-exponential-backoff-test (is (= 2000 (scalar/compute-exponential-backoff 1)))