       (is (nil? (:error f)))))
   (testing "If concurrency level exhausted, action rejected"
     (let [latch (CountDownLatch. 1)
-          _ (service/submit-action service (fn [] (.await latch)) Long/MAX_VALUE)
-          f (service/submit-action service (fn [] 1) Long/MAX_VALUE)]
+          _ (service/submit-action service (block-fn 1 latch) Long/MAX_VALUE)
+          f (service/submit-action service (success-fn 1) Long/MAX_VALUE)]
       (is (= :max-concurrency-level-exceeded @f))
       (is (= :rejected (:status f)))
       (.countDown latch))))

      (is (nil? (:error f)))))
  (testing "Submitted action can return error"
    (let [exception (IOException.)
          f (service/submit-action service (fn [] (throw exception)) 10000)]
      (is (= exception @f))
      (is (= exception (:error f)))
      (is (nil? (:result f)))
      (is (= :error (:status f)))))
  (testing "Submitted action can timeout"
    (let [latch (CountDownLatch. 1)
          f (service/submit-action service (fn [] (.await latch)) 50)]
      (is (= :timed-out @f))
      (is (= :timed-out (:status f)))
      (.countDown latch)

  (testing "Testing that metrics are updated with result of action"
    (let [metrics-service (fault/service 1 100)
          latch (CountDownLatch. 1)]
      @(service/submit-action metrics-service (success-fn 1) Long/MAX_VALUE)
      @(service/submit-action metrics-service (error-fn (IOException.)) Long/MAX_VALUE)
      @(service/submit-action metrics-service (block-fn 1 latch) 10)
      (.countDown latch)
      (is (= 1 (-> metrics-service :metrics :successes)))
      (is (= 1 (-> metrics-service :metrics :time-outs)))
