   ;; Nothing should be found yet.
   (assert-collections-and-granules-found [] [])
 
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  ;; Inserts
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
   ;; Insert collections
   (let [coll1 (make-coll 1)
         coll2 (make-coll 2)
         coll3 (make-coll 3)]
-    (index/wait-until-indexed)
     ;; The collections can be found
     (assert-collections-and-granules-found [coll1 coll2 coll3] [])
 

  ([collections]
   (assert-collections-found collections {}))
  ([collections params]
   (is (d/refs-match? collections (search/find-refs :collection params)))))

(defn assert-collections-and-granules-found

  ([granules]
   (assert-granules-found granules {}))
  ([granules params]
   (index/wait-until-indexed)
   (is (d/refs-match? granules (search/find-refs :granule params))
       (str "Could not find granules with " (pr-str params)))))

