 
 (start-peers! peers)
 
-(testing "It must complete in under 10 seconds"
-  (Thread/sleep 10000))
+(testing "All 30 tasks complete"
+  (loop []
+    (let [db (:db-after (.take tx-queue))
+          query '[:find (count ?task) :where [?task :task/complete? true]]
+          result (ffirst (d/q query db))]
+      (when-not (= result 30)
+        (recur)))))
 
 (let [db (d/db (:conn log))]
-  (testing "All 30 tasks completed"
-    (let [query '[:find (count ?task) :where [?task :task/complete? true]]
-          result (ffirst (d/q query db))]
-      (is (= result 30))))
-
   (testing "No tasks are left incomplete"
     (let [query '[:find (count ?task) :where [?task :task/complete? false]]
           result (ffirst (d/q query db))]

(def sync-storage (:sync components))

(def log (:log components))

(def offer-spy (chan 1000))



            (loop [payload-node payload]
              (<! sync-spy)

              (let [nodes (:nodes (extensions/read-place sync-storage payload-node))]
                (extensions/on-change sync-storage (:status nodes) #(go (>! status-spy %)))
