                                    (deliver (promise-chain (inc i)) i))
                                  i)
                                input)]
-        ;; All tasks should have started after 50ms.
-        (Thread/sleep 50)
+        ;; All tasks should have started after 100ms.
+        (Thread/sleep 100)
         (is (= @started (set input)))
         ;; Start the first task.
         (deliver (first promise-chain) nil)

                                i)
                              (range 10))]
        ;; start tasks
        (Thread/sleep 50)
        (deliver start true)
        (is (= [0 9 8 7 6 5 4 3 2 1]
               results)))))

          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"
