                first
                ba->s))))
 
-  (testing "Update val case"
+  (test/testing "Update val case"
     (tundra/put-key dstore (tkey :foo) (s->ba "hello world 1"))
     (tundra/put-key dstore (tkey :foo) (s->ba "hello world 2"))
     (is (= "hello world 2"

                                     (tkey 0) (tkey 1) (tkey 2))
                       (catch Exception _ nil)))

           (Thread/sleep 8000)          ; Wait for replication
           (mq/stop tworker)
           (wcar* (car/del (tkey 0))
                  (car/set (tkey 2) [:clj-val-new])) ; Make some local modifications



(deftest tundra-api-test-3
  (is (= [-1 -1 -1] ; nil eviction timeout (default) is respected!
         (let [tstore  (tundra/tundra-store dstore {:tqname tqname})
               tworker (tundra/worker tstore {} {:eoq-backoff-ms 100 :throttle-ms 100})]
           (wcar* (car/mset (tkey 0) "0" (tkey 1) "1" (tkey 2) "1") ; Clears timeouts
                  (tundra/dirty tstore (tkey 0) (tkey 1) (tkey 2)))
           (Thread/sleep 8000) ; Wait for replication
           (mq/stop tworker)
           (wcar* (tundra/ensure-ks tstore (tkey 0) (tkey 1) (tkey 2))
                  (mapv #(car/ttl (tkey %)) [0 1 2]))))))

(deftest tundra-api-test-4
  (test/testing "nnil eviction timeout is applied & extended correctly"
    (is ((fn [[t0 t1 t2]]
           (and (= t0 -1)
             (> t1  0)
             (> t2  t1)))

         (let [_       (clean-up!)
               tstore  (tundra/tundra-store dstore {:redis-ttl-ms (* 1000 60 60 24)
                                                    :tqname tqname})
               tworker (tundra/worker tstore {} {:eoq-backoff-ms 100 :throttle-ms 100
                                                 :auto-start false})]

           (wcar* (car/set (tkey 0) "0") ; Clears timeout
             (tundra/dirty tstore (tkey 0)))

           [(wcar* (car/pttl (tkey 0))) ; `dirty` doesn't set ttl immediately
            (do (mq/start tworker)
                (Thread/sleep 5000) ; Wait for replication (> exp-backoff)
                (mq/stop tworker)
                (wcar* (car/pttl (tkey 0)))) ; Worker sets ttl after successful put
            (do (Thread/sleep 1000)
                (wcar* (tundra/ensure-ks tstore (tkey 0))
                       (car/pttl (tkey 0))))])))))

(comment (clean-up!)
         (mq/queue-status {} mqname))
