   (testing "deleting the backend does not interrupt transfer"
     (let [be-process (slow-socat "test/fixtures/excerpt.txt" 100)]
       (with-running-server [prefix port]
-        (etcdctl (str "service/" domain-name "/aaa/listen-address")
-                 (str "localhost:" (:port be-process)))
-        (etcdctl (str "service/" domain-name "/aaa/last-seen-at")
-                 (.toString (java.time.Instant/now)))
+        (add-backend "aaa" (:port be-process))
         (Thread/sleep 500)
         (let [f (future (tcp-slurp port))]
           (Thread/sleep 4000)

    (.setSoTimeout s 1000)
    (slurp (io/reader (.getInputStream s)))))


(deftest download
  (testing "small file transfer"
    (let [be-process (socat "test/fixtures/excerpt.txt")]
      (with-running-server [prefix port]
        (etcdctl (str "service/" domain-name "/aaa/listen-address")
                 (str "localhost:" (:port be-process)))
        (etcdctl (str "service/" domain-name "/aaa/last-seen-at")
                 (.toString (java.time.Instant/now)))
        (Thread/sleep 500)
        (is (= (slurp "test/fixtures/excerpt.txt")
               (tcp-slurp port)))))))

  (testing "slow file transfer"
    (let [be-process (slow-socat "test/fixtures/excerpt.txt" 100)]
      (with-running-server [prefix port]
        (add-backend "aaa" (:port be-process))
        (Thread/sleep 500)
        (is (= (slurp "test/fixtures/excerpt.txt")
               (tcp-slurp port)))
