 (deftest test-invalid
   (let [[cl-sock srv-sock srv] (setup)]
     (try
-      (let [response (server-client-comm cl-sock srv srv-sock msg/invalid)]
+      (let [response (server-client-comm cl-sock srv srv-sock msg/goodbye)]
         (is (= HydraMsg/INVALID
                (.id response)))
-        (is (= :start
-               (-> @(:state srv) vals first))))
+        (is (empty? @(:state srv))))
       (finally
         (teardown cl-sock srv-sock)))))
 

      (let [response (server-client-comm cl-sock srv srv-sock msg/goodbye)]
        (is (= HydraMsg/GOODBYE_OK
               (.id response)))
        (is (= :connected
               (-> @(:state srv) vals first))))
      (finally
        (teardown cl-sock srv-sock)))))


        client-1 (msg/client-socket test-endpoint)
        client-2 (msg/client-socket test-endpoint)]
    (try
      (let [r1 (server-client-comm client-1 srv srv-sock msg/hello)
            r2 (server-client-comm client-2 srv srv-sock msg/hello)]
        (is (= 2 (count @(:state srv))))
        (is (= [:connected :connected]
               (-> @(:state srv) vals)))
        (server-client-comm client-1 srv srv-sock msg/goodbye)
        (is (= [:connected]
               (vals @(:state srv)))))
      (finally
        (teardown client-1 srv-sock)
        (.close (:socket client-2))))))
