             [metrics.counters :as counters]
             [metrics.gauges :as gauges]
             [metrics.timers :as timers]
-            [overtone.at-at :as at-at]
             [puppetlabs.puppetdb.cheshire :as json]
             [puppetlabs.puppetdb.cli.services :as cli-svc]
             [puppetlabs.puppetdb.http :as http]
+            [puppetlabs.puppetdb.testutils.db :refer [*db* with-test-db]]
             [puppetlabs.puppetdb.testutils.services :as svc-utils
-             :refer [*server* with-single-quiet-pdb-instance]]
+             :refer [*server*
+                     call-with-single-quiet-pdb-instance
+                     with-single-quiet-pdb-instance]]
             [puppetlabs.puppetdb.utils :as utils]
             [puppetlabs.trapperkeeper.app :refer [get-service]]
             [puppetlabs.trapperkeeper.services :refer [service-context]])
   (:import
    [java.util.concurrent CyclicBarrier]))
+
+(defmacro with-pdb-with-no-gc [& body]
+  `(with-test-db
+     (call-with-single-quiet-pdb-instance
+      (-> (svc-utils/create-temp-config)
+          (assoc :database *db*)
+          (assoc-in [:database :gc-interval] 0))
+      (fn []
+        ~@body))))
 
 (defn- post-admin [path form]
   (http-client/post (str (utils/base-url->str (svc-utils/pdb-admin-url))

  (gauges/value (:cleaning cli-svc/admin-metrics)))

(deftest admin-clean-status
  (with-single-quiet-pdb-instance
    (let [pdb (get-service *server* :PuppetDBServer)
          clean-serializer (Object.)  ; Ensures previous iteration has unlocked
          orig-clean @#'cli-svc/clean-puppetdb
          orig-finish @#'cli-svc/finishing-clean-up
          in-clean (CyclicBarrier. 2)
          test-finished (CyclicBarrier. 2)]
      ;; Stop intermittent cleaning so it can't interfere
      (at-at/stop-and-reset-pool! (:job-pool (service-context pdb)))
      (with-redefs [cli-svc/clean-puppetdb #(locking clean-serializer
                                              (apply orig-clean %&))
                    cli-svc/finishing-clean-up (fn [& args]

           (:other-clean-time cli-svc/admin-metrics))})

(defn- check-counts [get-counts]
  (with-pdb-with-no-gc
    (let [pdb (get-service *server* :PuppetDBServer)]
      (doseq [requested (combinations ["expire_nodes" "purge_nodes"
                                       "purge_reports"
                                       "other"]
