           start (promise)
           f (.submit pool (callable #(deref start)))]
       (is (false? (cp/shutdown? pool)))
-      (Thread/sleep 50)
+      (Thread/sleep 100)
       ;; Make sure the threadpool completes shutting down immediately.
       (cp/shutdown! pool)
       (is (true? (cp/shutdown? pool)))
       ;; It can take some time for the threadpool to kill the threads.
-      (Thread/sleep 50)
+      (Thread/sleep 100)
       (is (true? (.isTerminated pool)))
       (is (.isDone f))
       (is (thrown? ExecutionException (deref f)))))

          (deliver outside-pool pool)
          ;; Use a future to avoid blocking on the :serial case.
          (deliver fp (future (.submit pool #(deref start))))
          (Thread/sleep 50))
        ;; Make sure outside of the with-shutdown block the pool is properly
        ;; killed.
        (when-not (keyword? arg) (is (true? (cp/shutdown? @outside-pool)))
          (Thread/sleep 50)
          (is (true? (.isTerminated @outside-pool)))
          (deliver start true)
          (Thread/sleep 50)
          (is (.isDone @@fp))
          (is (thrown? ExecutionException (deref @@fp)))))))
  (testing "With-shutdown! works with any number of threadpools"

          result (promise)
          f (.submit pool (callable #(deliver result (deref start))))]
      (is (false? (cp/shutdown? pool)))
      (Thread/sleep 100)
      ;; Make sure the threadpool starts shutting down but doesn't complete
      ;; until the threads finish.
      (cp/shutdown pool)
      (is (true? (cp/shutdown? pool)))
      (is (false? (.isTerminated pool)))
      (Thread/sleep 100)
      (deliver start true)
      (Thread/sleep 100)
      (is (true? (.isTerminated pool)))
      (is (true? @result))))
  (testing "Shutdown does not affect builtin threadpool"
