           (is (re-seq #".+WARN.+WebSocket connection closed with status code 1009 \(Too large\) and reason: Text message size.+exceeds maximum size.+"
                       output)))))
     (testing "specified limit (2MB)"
-      (let [automation (make-automation {:max-msg-size-mb (* 1024 1024 2)})
+      (let [conn (make-conn {:max-msg-size-mb (* 1024 1024 2)})
+            automation (create-automation conn)
             eval-timeout-ms 1000 ; Specify a short timeout because this error case would otherwise
                                  ; cause evaluate to hang until its default timeout of 60 seconds
                                  ; elapses, which would just be too slow.

                      output))
          (is (re-seq #".+WARN.+WebSocket connection closed with status code 1009 \(Too large\) and reason: Text message size.+exceeds maximum size.+"
                      output)))))))

                                                   (swap! log conj formatted-output-str)))}}})
    log))

(defn- make-conn
  "The main reason we need this is so it’ll use the value of the port var. See the comment on that
  var above."
  ([] (make-conn {}))
  ([client-config]
   (let [client (c/make-ws-client client-config)
         max-wait-time-ms 1000]
     (c/connect "localhost" port max-wait-time-ms client))))

(deftest logging
  (testing "messages that are larger than the max should cause an error to be logged"
