diff --git a/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java b/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java index bc59576679..5f9323b770 100644 --- a/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java @@ -35,7 +35,7 @@ public class MultiBrokersMultiClientsTest extends JmsMultipleBrokersTestSupport public static final int BROKER_COUNT = 2; // number of brokers to network public static final int CONSUMER_COUNT = 3; // consumers per broker public static final int PRODUCER_COUNT = 3; // producers per broker - public static final int MESSAGE_COUNT = 10; // messages per producer + public static final int MESSAGE_COUNT = 20; // messages per producer protected Map consumerMap; @@ -68,7 +68,7 @@ public class MultiBrokersMultiClientsTest extends JmsMultipleBrokersTestSupport } } - assertTrue("Missing " + latch.getCount() + " messages", latch.await(30, TimeUnit.SECONDS)); + assertTrue("Missing " + latch.getCount() + " messages", latch.await(45, TimeUnit.SECONDS)); // Get message count for (int i = 1; i <= BROKER_COUNT; i++) { @@ -97,7 +97,10 @@ public class MultiBrokersMultiClientsTest extends JmsMultipleBrokersTestSupport } // wait for consumers to get propagated - Thread.sleep(5000); + for (int i = 1; i <= BROKER_COUNT; i++) { + // all consumers on the remote brokers look like 1 consumer to the local broker. + assertConsumersConnect("Broker" + i, dest, (BROKER_COUNT-1)+CONSUMER_COUNT, 30000); + } // Send messages for (int i = 1; i <= BROKER_COUNT; i++) { @@ -107,7 +110,7 @@ public class MultiBrokersMultiClientsTest extends JmsMultipleBrokersTestSupport } // Wait for messages to be delivered - assertTrue("Missing " + latch.getCount() + " messages", latch.await(30, TimeUnit.SECONDS)); + assertTrue("Missing " + latch.getCount() + " messages", latch.await(45, TimeUnit.SECONDS)); // Get message count int totalMsg = 0;