From 59748a5ce093a27f1d441f994c1dca2f53dffbb9 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 18 Dec 2019 23:06:51 +0100 Subject: [PATCH] [#166] unit test: wait/wait-for-port closes connection --- test/babashka/main_test.clj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/babashka/main_test.clj b/test/babashka/main_test.clj index 81affbd8..ae9af243 100644 --- a/test/babashka/main_test.clj +++ b/test/babashka/main_test.clj @@ -190,7 +190,14 @@ (wait/wait-for-port \"127.0.0.1\" 1777) (.destroy ws) (.waitFor ws) - (wait/wait-for-port \"localhost\" 1777 {:default :timed-out :timeout 50})")))) + (wait/wait-for-port \"localhost\" 1777 {:default :timed-out :timeout 50})"))) + (is (int? (bb nil " +(require '[babashka.wait :as wait]) +(def ws (-> (ProcessBuilder. [\"python\" \"-m\" \"SimpleHTTPServer\" \"1777\"]) (.start))) +(wait/wait-for-port \"localhost\" 1777) +(slurp \"http://localhost:1777\") +(.destroy ws) +(.waitFor ws)")))) (deftest wait-for-path-test (let [temp-dir-path (System/getProperty "java.io.tmpdir")]