Each account's age will start from 1
This makes it slightly more clean when comparing against the number of records.
(def ^:const ACCOUNT_ID "account_id")
(def ^:const BALANCE "balance")
(def ^:const AGE "age")
-
(def ^:const INITIAL_BALANCE 10000)
(def ^:const NUM_ACCOUNTS 10)
(def ^:const total-balance (* NUM_ACCOUNTS INITIAL_BALANCE))
-
(def ^:const NUM_FAILURES_FOR_RECONNECTION 1000)
(defn- create-transfer-table!
(try
(dotimes [i n]
(->>
- (prepare-put i 0 balance)
+ (prepare-put i 1 balance)
(.put tx)))
(.commit tx)
(catch Exception e
actual-age (->> read-result
(map :age)
(reduce +))
- expected-age (let [num-records (->> history
+ expected-age (->> history
(r/filter #(= :get-num-records (:f %)))
(into [])
last
- :value)]
- (- num-records (:num (:model test)))) ; age starts at 0 so should be num-records minus num-accounts
+ :value)
bad-age (if-not (= actual-age expected-age)
{:type :wrong-age
:expected expected-age
