   (GET "/ws3" [] ws-handler3)
   (GET "/ws4" [] ws-handler4)
   (GET "/binary" [] binary-ws-handler)
-  (GET "/interleaved" [] big-messg-order)
+  (GET "/interleaved" [] not-interleave-handler)
   (GET "/order" [] messg-order-handler))
 
 (use-fixtures :once (fn [f]

                (send! con (str (= id i)))))]
      (on-receive con h))))

(defn- repeat-str [n ch]  (apply str (repeat n ch)))

(defn big-messg-order [req]
  (with-channel req con
    (doall (pmap (fn [length]
                   (let [length (+ length 1025)
                         c (char (+ (int \0) (rem length 30)))]
                     (send! con (apply str (repeat length c)))))
                 (repeatedly 25 (partial rand-int (* 1024 1024)))))))

(defroutes test-routes
  (GET "/ws" [] ws-handler)

      (.close client))))

(deftest test-message-are-not-interleaved
  ;; TODO when length is large, http-kit seem to drop some buffer.
  ;; The problem remains even if writen is done by a signle Thread
  ;; A bug of http-kit or JVM?
  ;; Not a issue for http, But maybe a issue for websocket:
  ;; If write many large chunks of messages to client using many threads concurrenly
  (let [client (WebSocketClient. "ws://localhost:4348/interleaved")
        length 10]
    (.sendMessage client (str length))
    (doseq [i (range 0 length)]
      (let [mesg ^String (.getMessage client)]
        (if mesg
          (let [idx (.substring mesg 0 4)
                mesg (.substring mesg 4)
                ch (first mesg)]
            (is (every? (fn [c] (= c ch)) mesg)))
          ;; fail
          (is (> (count mesg) 1024)))))
    (.close client)))

(deftest test-with-http.async.client
