 
 (onyx.api/kill-job peer-config j1)
 
-(def replica-4
-  (loop [replica replica-3]
+(def replica-2
+  (loop [replica replica-1]
     (let [position (<!! ch)
           entry (extensions/read-log-entry (:log env) position)
-          new-replica (extensions/apply-log-entry entry replica)]
+          new-replica (extensions/apply-log-entry entry replica)
+          task-a (nth (get-in new-replica [:tasks j1]) 0)
+          task-b (nth (get-in new-replica [:tasks j1]) 1)
+          task-c (nth (get-in new-replica [:tasks j1]) 2)
+          task-d (nth (get-in new-replica [:tasks j2]) 0)
+          task-e (nth (get-in new-replica [:tasks j2]) 1)
+          task-f (nth (get-in new-replica [:tasks j2]) 2)]
+      (println "round robin multi job test " task-d task-e task-f
+                   (count (get (get (:allocations new-replica) j1) task-a))
+                   (count (get (get (:allocations new-replica) j1) task-b))
+                   (count (get (get (:allocations new-replica) j1) task-c))
+                   (count (get (get (:allocations new-replica) j2) task-d))
+                   (count (get (get (:allocations new-replica) j2) task-e))
+                   (count (get (get (:allocations new-replica) j2) task-f)))
       (if-not (and (= (count (get (get (:allocations new-replica) j1) task-a)) 0)
                    (= (count (get (get (:allocations new-replica) j1) task-b)) 0)
                    (= (count (get (get (:allocations new-replica) j1) task-c)) 0)

  (onyx.api/shutdown-peer v-peer))

(onyx.api/shutdown-env env)



(def peer-config
  (assoc (:peer-config config)
         :onyx/id onyx-id
         :onyx.peer/job-scheduler :onyx.job-scheduler/round-robin))

(def env (onyx.api/start-env env-config))

