jbertram commented on a change in pull request #2887: NO-JIRA make OpenWire 
test more robust
URL: https://github.com/apache/activemq-artemis/pull/2887#discussion_r344226071
 
 

 ##########
 File path: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java
 ##########
 @@ -64,20 +66,23 @@ public void testClusteredQueue() throws Exception {
          Session session2 = conn2.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
          Queue targetQueue2 = session2.createQueue(QUEUE_NAME);
 
-
          this.waitForBindings(servers[0], QUEUE_NAME, true, 1, 0, 2000);
          this.waitForBindings(servers[1], QUEUE_NAME, true, 1, 0, 2000);
          this.waitForBindings(servers[1], QUEUE_NAME, false, 1, 0, 2000);
          this.waitForBindings(servers[0], QUEUE_NAME, false, 1, 0, 2000);
 
-
          MessageProducer prod1 = session1.createProducer(targetQueue1);
          MessageConsumer cons2 = session2.createConsumer(targetQueue2);
 
+         this.waitForBindings(servers[0], QUEUE_NAME, false, 1, 1, 2000);
 
 Review comment:
   To be clear, the issue isn't a race between creating a producer and sending 
the message. It's between creating the consumer on node 2 of the cluster and 
sending the message to node 1. When the consumer is created on node 2 the 
broker tells node 1 about it so messages can be routed from node 2 to node 1 if 
necessary. This happens asynchronously which introduces the possibility of a 
race (i.e. if the message is sent to node 1 before it knows about the consumer 
on node 2).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to