Skip to content

Commit

Permalink
Use the constants in core_test.cli
Browse files Browse the repository at this point in the history
  • Loading branch information
komamitsu committed Oct 29, 2024
1 parent ce9087f commit dec8f46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scalardb/test/scalardb/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit dec8f46

Please sign in to comment.