diff --git a/test/datascript/test/core.cljc b/test/datascript/test/core.cljc index 9fcd6986..2c759a5c 100644 --- a/test/datascript/test/core.cljc +++ b/test/datascript/test/core.cljc @@ -94,10 +94,11 @@ :cljs (.getTime (js/Date.)))) (deftest test-uuid - (loop [] - (when (> (mod (now) 1000) 990) ;; sleeping over end of a second - (recur))) - (let [now-ms (now) + (let [now-ms (loop [] + (let [ts (now)] + (if (> (mod ts 1000) 900) ;; sleeping over end of a second + (recur) + ts))) now (int (/ now-ms 1000))] (is (= (* 1000 now) (d/squuid-time-millis (d/squuid)))) (is (not= (d/squuid) (d/squuid)))