        :done nil)))
 
 (defcoretest handling-100-continue-requests-with-100-response
-  [ch]
-  (fn [upstream request]
-    (enqueue ch [:request request])
+  (deftrackedapp [upstream request]
     (upstream :response [100])
     (fn [evt val]
-      (enqueue ch [evt val])
       (when (= :done evt)
-        (upstream :response [200 {"content-length" "5"} "Hello"]))))
+        (upstream :response [200 {"content-ength" "5"} "Hello"]))))
 
   (http-write "POST / HTTP/1.1\r\n"
               "Content-Length: 5\r\n"

       :resume  nil)))

(defcoretest raising-error-during-pause-event
  [ch]
  (fn [resp request]
    (enqueue ch [:request request])
    (let [latch (atom true)]
      (resp :response [200 {"transfer-encoding" "chunked"} :chunked])
      (bg-while @latch (resp :body "HAMMER TIME!"))
      (fn [evt val]
        (enqueue ch [evt val])
        (when (= :pause evt)
          (swap! latch (fn [_] false))
          (throw (Exception. "fail"))))))

  (is (not-receiving-messages)))

(defcoretest raising-error-during-resume-event
  (deftrackedapp [upstream request]
    (let [latch (atom true)]
      (upstream :response [200 {"transfer-encoding" "chunked"} :chunked])
      (bg-while @latch (upstream :body "HAMMER TIME!"))
      (fn [evt val]
        (when (= :pause evt) (toggle! latch))
        (when (= :resume evt)
          (throw (Exception. "fail"))))))
