Skip to content

Commit 1d7e569

Browse files
committed
eliminate non-determinism in mult test
first input to mult must be supplied after chan closed to ensure close will be seen
1 parent 20b1530 commit 1d7e569

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/clojure/clojure/core/async_test.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
(<!! (a/into [] b)))))
293293

294294
;; ASYNC-127
295-
(let [ch (to-chan! [1 2 3])
295+
(let [ch (chan)
296296
m (mult ch)
297297
t-1 (chan)
298298
t-2 (chan)
@@ -301,6 +301,7 @@
301301
(tap m t-2)
302302
(tap m t-3)
303303
(close! t-3)
304+
(onto-chan! ch [1 2 3])
304305
(is (= 1 (<!! t-1)))
305306
(is (= nil (a/poll! t-1))) ;; t-2 hasn't taken yet
306307
(is (= 1 (<!! t-2)))

0 commit comments

Comments
 (0)