        :abort   nil)))
 
 (defcoretest applications-raising-errors
-  [ch]
-  (fn [resp request]
-    (enqueue ch [:request request])
+  (deftrackedapp [upstream request]
     (throw (Exception. "TROLL APP IS TROLLIN'")))
 
   (http-write "GET / HTTP/1.1\r\n\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"))))))

       :request [(includes-hdrs {"connection" "close"}) nil])))

(defcoretest aborting-a-request
  (tracking-middleware hello-world-app)

  (http-write "POST / HTTP/1.1\r\n"
              "Content-Length: 10000\r\n\r\n"
