       (is (= :timeout (:status f)))
       (.countDown latch)
       (is (nil? (:result f)))
-      (is (nil? (:error f)))))
+      (is (nil? (:error f)))
+      (try
+        @f
+        (is false)
+        (catch ExecutionException e
+          (is (instance? ActionTimeoutException (.getCause e)))))))
   (testing "If concurrency level exhausted, action rejected"
     (let [latch (CountDownLatch. 1)
           _ (service/submit-action service (block-fn 1 latch) Long/MAX_VALUE)

  (testing "Submitted action can timeout"
    (let [latch (CountDownLatch. 1)
          f (service/submit-action service (block-fn 1 latch) 50)]
      ;; TODO: Should change when precipice changes.
      (is (nil? @f))
      (is (:timeout? f))
      (is (not (:success? f)))
      (is (not (:error? f)))

            [beehive.service :as service]
            [beehive.future :as f])
  (:import (java.io IOException)
           (java.util.concurrent CountDownLatch ExecutionException)
           (net.uncontended.precipice.timeout ActionTimeoutException)))

(set! *warn-on-reflection* true)

