                                              (.position frame))
                                         result (byte-array n)]
                                     (.get frame result)
-                                    (conj acc frame)))
+                                    (conj acc result)))
                                 []
                                 frames)
           decoded (map (partial decode-bytes->child
                                 decode-src
-                                decode-sink) binary-frames)]
+                                decode-sink)
+                       binary-frames)]
+      (dorun decoded)
       (is (= 2 (count frames)))
       (is (= 2 (count binary-frames)))
       (is (= 2 (count decoded)))

      ;; Just glancing at the gloss source code,
      ;; based on what I know about it, really
      ;; seems as though this should work.
      (is (= msg (second decoded))))))

(deftest handshake


(defn decode-bytes->child
  [decode-src decode-sink bs]
  (comment (log/debug "Trying to decode" bs))
  (if-not (keyword? bs)
    (let [decoded (strm/try-take! decode-sink ::drained 10 false)]
      (log/debug "Putting bytes into decoder")
      (strm/put! decode-src bs)
      (log/debug "Waiting for bytes to come out of decoder")
      (deref decoded 10 false))
    bs))

(defn server-mock-child
