     (let [position (<!! ch)
           entry (extensions/read-log-entry (:log env) position)
           new-replica (extensions/apply-log-entry entry replica)]
-      (if (= (count (:c (get (:allocations new-replica) j2))) 40)
+      (if (= (count (get (get (:allocations new-replica) j2) task-c)) 40)
         new-replica
         (recur new-replica)))))
 
 (fact "All peers were reallocated to job 2, task C" true => true)
 
-(def entry (create-log-entry :complete-task {:job j2 :task :c}))
+(def entry (create-log-entry :complete-task {:job j2 :task task-c}))
 
 (extensions/write-log-entry (:log env) entry)
 

(fact "No peers are executing any tasks" true => true)

(doseq [v-peer v-peers]
  (try
    ((:shutdown-fn v-peer))
    (catch Exception e (prn e))))

(component/stop env)


    (let [position (<!! ch)
          entry (extensions/read-log-entry (:log env) position)
          new-replica (extensions/apply-log-entry entry replica)]
      (if (and (= (count (get (get (:allocations new-replica) j1) task-a)) 40)
               (zero? (apply + (map count (vals (get (:allocations new-replica) j2))))))
        new-replica
        (recur new-replica)))))

(fact "All peers were reallocated to job 1, task B" true => true)

(def entry (create-log-entry :complete-task {:job j1 :task task-b}))

(extensions/write-log-entry (:log env) entry)

