                      (partition-by #(= [:reset-messenger] %))
                      (remove (fn [run] (= #{[:reset-messenger]} (set run)))))]
       (let [segments (apply concat run)
-            ;; We only care about ordering of segments coming from the same input
             group-by-input (->> segments 
                                 ;; Don't include messaged state
                                 (remove :state-output?)
-                                (group-by #(first (:path %))))]
+                                ;; We only care about ordering of segments that followed the same path through peers
+                                (group-by :peer-path))]
         (doseq [[input-task segments] group-by-input]
-          ;; FIXME: why less than or equal
           (prop-is (apply < (map :n segments))
                    (str (mapv :n segments)) 
                    (str "outputs not in order " input-task " " segments)))))))

;;;;;;;;;
;; Job code

(defn add-path [job-id task+slot {:keys [n] :as segment}]
  (update segment :path conj [job-id task+slot]))

(def add-paths-calls
  {:lifecycle/before-task-start 
   (fn [event lifecycle]
     (if (= :input (:onyx/type (:task-map event))) 
       ;; include slot combinations with input
       {:params [(:job-id event) [(:task event) (:slot-id event)]]}
       {:params [(:job-id event) [(:task event)]]}))})

(defn add-paths-lifecycles [job]
  (update job 

    (prop-is (= (count (:peers model)) (count (:peers replica))) "peers")
    ;(println "STATE ATOM" @state-atom)
    (state-properties expected-state @state-atom)
    ;(println "Flow outputs " flow-outputs)
    
    ; (prop-is (= expected-state 
    ;             ;; Potentially should check for state ordering here
