                       "is being executed")
           (.unregister pool last-instance))
 
-        @lock-thread
+        (is (true? (timed-deref lock-thread))
+            "timed out waiting for the lock thread to finish")
         (is (.isLocked pool))))))
 
 (deftest pool-lock-blocks-borrows-test

      (is (not (.isLocked pool)))
      (.lock pool)
      (is (.isLocked pool))
      (is (nil? @(future (.borrowItemWithTimeout pool
                                                 1
                                                 TimeUnit/MICROSECONDS))))
      (.unlock pool)
      (is (not (nil? @(future (.borrowItemWithTimeout pool
                                                      1
                                                      TimeUnit/MICROSECONDS)))))
      (is (not (.isLocked pool))))))

(deftest pool-borrow-blocks-borrow-when-pool-empty

            borrow-thread-1 (future (deliver borrow-thread-started-1? true)
                                    (let [instance (.borrowItem pool)]
                                      (deliver borrow-thread-borrowed-1? true)
                                      (.releaseItem pool instance))
                                    true)
            borrow-thread-2 (future (deliver borrow-thread-started-2? true)
                                    (let [instance (.borrowItem pool)]
                                      (deliver borrow-thread-borrowed-2? true)
                                      (.releaseItem pool instance))
                                    true)]
        @borrow-thread-started-1?
        @borrow-thread-started-2?
        (is (not (realized? borrow-thread-borrowed-1?)))
