   (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))))))
+        (is (deref connected 10000 nil))))))
 
 (def inventory-request (message/make-message
                          {:message_type "http://puppetlabs.com/inventory_request"

        (server/wait-for-inbound-connection (get-context app :MockServer))
        (with-open [client (client/connect :certname agent-cert)]
          ;; Verify we get an inventory including the client
          (let [inventory-answer (deref inventory-response 3000 nil)]
            (is inventory-answer)
            (is (= "http://puppetlabs.com/inventory_response" (:message_type inventory-answer)))
            (is (= (:id inventory-request) (:in_reply_to inventory-answer)))

          (with-open [client (client/connect :certname agent-cert)]
            (while (empty? (:inventory @(:database broker)))
              (Thread/sleep 100))
            (let [answer (deref inventory-response 10000 nil)]
              (is answer)
              (is (= (:id inventory-subscribe) (:in_reply_to answer))))
            (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 10000 nil))
            (deliver controller-timeout? true)
            (testing "updates for disconnected controllers are discarded, not sent"
              (is @clients-purged?)
