Skip to content

Commit ef67b24

Browse files
committed
Work around race in tests
1 parent 6ac608a commit ef67b24

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/clj_ssh/ssh_test.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@
616616
(testing ":out :stream"
617617
(let [proc (ssh s {:cmd "ls" :out :stream :pty true})]
618618
(is (> (count (slurp (:out-stream proc))) 1) ":out-stream")
619+
(while (connected-channel? (:channel proc))
620+
(Thread/sleep 100))
619621
(is (not (connected-channel? (:channel proc)))
620622
":channel not connected")
621623
(is (zero? (exit-status (:channel proc)))
@@ -628,6 +630,8 @@
628630
(testing ":out stream"
629631
(let [proc (ssh s {:in "ls" :out :stream})]
630632
(is (> (count (slurp (:out-stream proc))) 1) ":out-stream")
633+
(while (connected-channel? (:channel proc))
634+
(Thread/sleep 100))
631635
(is (not (connected-channel? (:channel proc)))
632636
":channel not connected")
633637
(is (zero? (exit-status (:channel proc)))

0 commit comments

Comments
 (0)