Skip to content

Commit

Permalink
Using remote listen instead of receive
Browse files Browse the repository at this point in the history
This seems to avoid the occasional hang due to IMMUTANT-542. I still
prefer the use of "repeatedly receive" but at this point the only
vulnerability to the hang is getting the initial host in the failover
test.
  • Loading branch information
jcrossley3 committed Mar 24, 2015
1 parent f7c5201 commit 50da130
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions integration-tests/test-clustering/integs/cluster_test.clj
Expand Up @@ -80,7 +80,13 @@
ctx2 (msg/context (assoc opts :port (http-port "server-two")))]
(let [q1 (msg/queue "/queue/cluster" :context ctx1)
q2 (msg/queue "/queue/cluster" :context ctx2)
c 3]
p (promise)
c 10]
(msg/listen q2 (let [v (atom [])]
(fn [m]
(swap! v conj m)
(when (= c (count @v))
(deliver p @v)))))
(dotimes [i c]
(msg/publish q1 i))
(is (= (range c) (repeatedly c (partial msg/receive q2)))))))
(is (= (range c) (deref p 10000 nil))))))

0 comments on commit 50da130

Please sign in to comment.