Skip to content

Commit 47c9454

Browse files
Merge pull request #627 from clj-commons/stabilize-test-idle-timeout
Stabilize `aleph.http-test/test-idle-timeout`
2 parents ae3f589 + e337498 commit 47c9454

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/aleph/http_test.clj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,14 @@
541541
(d/chain' (fn [_] (s/close! body))))
542542
body))
543543

544+
(defn force-stream-to-string-memoization! []
545+
(bs/to-string (doto (s/stream 1) (s/put! "x") s/close!)))
546+
544547
(deftest test-idle-timeout
548+
;; Required so that the conversion initialization doesn't count
549+
;; toward the idle timeout. See
550+
;; https://github.com/clj-commons/aleph/issues/626 for background.
551+
(force-stream-to-string-memoization!)
545552
(let [url (str "http://localhost:" port)
546553
echo-handler (fn [{:keys [body]}] {:body (bs/to-string body)})
547554
slow-handler (fn [_] {:body (slow-stream)})]

0 commit comments

Comments
 (0)