       (let [response (server-client-comm cl-sock srv srv-sock msg/goodbye)]
         (is (= HydraMsg/GOODBYE_OK
                (.id response)))
-        (is (= :connected
-               (-> @(:state srv) vals first))))
+        (is (empty? @(:state srv))))
       (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/goodbye)
            r2 (server-client-comm client-2 srv srv-sock msg/get-tags)]
        (is (= 2 (count @(:state srv))))
        (is (= [:start :start]
               (-> @(:state srv) vals)))
        (server-client-comm client-1 srv srv-sock msg/hello)
        (is (= {:start 1 :connected 1}
               (frequencies (vals @(:state srv))))))
      (finally
        (teardown client-1 srv-sock)
        (.close (:socket client-2))))))

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

