           (when should-we-shutdown?
             (cp/shutdown! @apool)))))))
 
+(defn check-shuts-off
+  [pmap-like]
+  (cp/with-shutdown! [pool 2]
+    (let [;; A lazy blocking trap
+          blocker (map deref [(promise)])
+          started (atom [])
+          f (fn [x]
+              (Thread/sleep 1)
+              (swap! started conj x)
+              (when (= x 10)
+                (throw (Exception. (str x))))
+              x)
+          results (pmap-like pool f (concat (impl/unchunk (range 200)) blocker))]
+      (Thread/sleep 300)
+      ;; Surely we hit the exception.
+      (is (thrown? Exception (doall results)))
+      ;; Surely we didn't start every task.
+      (is (< 1 (count @started) 100))
+      ;; Surely something, but not everything, is returned, and we do not
+      ;; block.
+      (is (< 1 (count results) 100)))))
+
 (defn check-all
   "Run all checks on a pmap function."
-  [fn-name pmap-like ordered?]
+  [fn-name pmap-like ordered? lazy?]
   (testing (format "%s runs n things at once" fn-name)
     (check-parallel pmap-like ordered?))
   (testing (format "%s emits exceptions correctly" fn-name)

                               input)]
        ;; All tasks should have started after 100ms.
        (Thread/sleep 100)
        (is (= @started (set input)))
        ;; Start the first task.
        (deliver (first promise-chain) nil)
        ;; Tasks should complete in numerical order, the opposite of the order

              pool
              [i input]
              (work i)))]
    (check-all "pfor" pmap-like true true)
    (testing "pfor reads lazily"
      (check-lazy-read pmap-like))))

