Skip to content

Commit

Permalink
eliminate non-determinism in mult test
Browse files Browse the repository at this point in the history
first input to mult must be supplied after chan closed
to ensure close will be seen
  • Loading branch information
ghadishayban committed Dec 10, 2024
1 parent 20b1530 commit 1d7e569
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/clojure/clojure/core/async_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
(<!! (a/into [] b)))))

;; ASYNC-127
(let [ch (to-chan! [1 2 3])
(let [ch (chan)
m (mult ch)
t-1 (chan)
t-2 (chan)
Expand All @@ -301,6 +301,7 @@
(tap m t-2)
(tap m t-3)
(close! t-3)
(onto-chan! ch [1 2 3])
(is (= 1 (<!! t-1)))
(is (= nil (a/poll! t-1))) ;; t-2 hasn't taken yet
(is (= 1 (<!! t-2)))
Expand Down

0 comments on commit 1d7e569

Please sign in to comment.