Repository: activemq
Updated Branches:
  refs/heads/master 0e02b678d -> 87087fc93


no-jira - fix flaky test that depends on the broker processing the previous ack


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/87087fc9
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/87087fc9
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/87087fc9

Branch: refs/heads/master
Commit: 87087fc93079232a6651294f30d58a3c202cece3
Parents: 0e02b67
Author: gtully <[email protected]>
Authored: Mon Oct 22 11:50:54 2018 +0100
Committer: gtully <[email protected]>
Committed: Mon Oct 22 11:50:54 2018 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/broker/BrokerRedeliveryTest.java    | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/87087fc9/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
----------------------------------------------------------------------
diff --git 
a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
 
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
index 90e33ab..fbc0212 100644
--- 
a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
+++ 
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
@@ -32,6 +32,7 @@ import 
org.apache.activemq.broker.region.policy.RedeliveryPolicyMap;
 import org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy;
 import org.apache.activemq.broker.util.RedeliveryPlugin;
 import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.util.Wait;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -160,6 +161,14 @@ public class BrokerRedeliveryTest extends 
org.apache.activemq.TestSupport {
         assertNotNull("got message", message);
         message.acknowledge();
 
+        Wait.waitFor(new Wait.Condition() {
+            @Override
+            public boolean isSatisified() throws Exception {
+                // wait for ack to be processes
+                LOG.info("Total message count: " + 
broker.getAdminView().getTotalMessageCount());
+                return broker.getAdminView().getTotalMessageCount() == 0;
+            }
+        });
         // send it again
         // should go to dlq as a duplicate from the store
         producerConnection.getTransport().request(message);

Reply via email to