           (with-open [client (client/connect :certname agent-cert)]
             (while (empty? (:inventory @(:database broker)))
               (Thread/sleep 100))
-            (let [answer (deref inventory-response 3000 nil)]
+            (let [answer (deref inventory-response 10000 nil)]
               (is answer)
               (is (= (:id inventory-subscribe) (:in_reply_to answer))))
-            (is (deref first-update-sent? 3000 nil))
+            (is (deref first-update-sent? 10000 nil))
             ;; Disconnect the mock server
             (doseq [ws @(:inventory (get-context app :MockServer))]
               (websockets-client/close! ws))
-            (is (deref removed-subscription 3000 nil))
+            (is (deref removed-subscription 10000 nil))
             (deliver controller-timeout? true)
             (testing "updates for disconnected controllers are discarded, not sent"
               (is @clients-purged?)

  (let [connected (promise)]
    (with-redefs [server/on-connect (fn [_ ws] (deliver connected true))]
      (with-app-with-config app (conj broker-services server/mock-server) broker-config
        (is (deref connected 3000 nil))))))

(def inventory-request (message/make-message
                         {:message_type "http://puppetlabs.com/inventory_request"

                      (catch Exception e (println "controller-prevent-spoofed-sender-test exception:" (.getMessage e)))))
                  server/on-text (fn [_ ws text] (deliver response (message/decode text)))]
      (with-app-with-config app (conj broker-services server/mock-server) broker-config
        (let [answer (deref response 10000 nil)]
          (is answer)
          (is (= "http://puppetlabs.com/error_message" (:message_type answer)))
          (is (= (:id spoof-sender-request) (:in_reply_to answer)))
