 (def gen-command
   (gen/one-of [gen-messages gen-acks gen-completion gen-retry]))
 
-#_(deftest messenger-gen-test 
+(deftest messenger-gen-test 
   (let [peer-group (onyx.api/start-peer-group peer-config)] 
     (try 
       (checking "all generated messages are received"
-                (times 500)
+                (times 20)
                 [commands (gen/vector gen-command)]
-                (println "Commands " commands)
                 (let [grouped-model (group-by :command commands) 
                       model-results (zipmap (keys grouped-model)
                                             (map (fn [v] (set (flatten (map :payload v)))) 

  (fn [messenger _ _ _] 
    (fn [^ChannelHandlerContext ctx ^ByteBuf buf]
      (try 
        (let [msg (protocol/read-buf (:decompress-f messenger) buf)]
          (let [t ^byte (:type msg)]
            (cond (= t protocol/messages-type-id) 
                  (doseq [message (:messages msg)]
                    (swap! received update-in [:messages] conj message))

                  (= t protocol/ack-type-id)
                  (swap! received update-in [:acks] into (:acks msg))

                  (= t protocol/completion-type-id)
                  (swap! received update-in [:complete] conj (:id msg))

                  (= t protocol/retry-type-id)
                  (swap! received update-in [:retry] conj (:id msg))

                  :else
                  (throw (ex-info "Unexpected message received from Netty" {:message msg})))))
        (catch Throwable e
          (taoensso.timbre/error e)
          (throw e))))))

            [onyx.system :as system]
            [onyx.extensions :as ext]
            [onyx.api]
            [onyx.types :refer [map->Leaf map->Ack]]
            [com.stuartsierra.component :as component]
            [onyx.test-helper :refer [load-config]]
            [com.gfredericks.test.chuck :refer [times]]
