jeanouii commented on code in PR #1668:
URL: https://github.com/apache/activemq/pull/1668#discussion_r2800133401


##########
activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AdvisoryViaNetworkTest.java:
##########
@@ -270,18 +272,27 @@ public void testPrefetchSizePercent() throws Exception {
             createConsumer("A", new ActiveMQTopic("A.FOO"));
         }
 
-        assertDeqInflight(7, 3);
+        assertDeqInflight(7, 3, new ActiveMQTopic("A.FOO"));
     }
 
-    private void assertDeqInflight(final int dequeue, final int inflight) 
throws Exception {
+    private void assertDeqInflight(final int dequeue, final int inflight,
+                                   final ActiveMQTopic... topics) throws 
Exception {
         assertTrue("deq and inflight as expected", Wait.waitFor(new 
Wait.Condition() {
             @Override
             public boolean isSatisified() throws Exception {
-                RegionBroker regionBroker = (RegionBroker) 
brokers.get("A").broker.getRegionBroker();
-                LOG.info("A Deq:" + 
regionBroker.getDestinationStatistics().getDequeues().getCount());
-                LOG.info("A Inflight:" + 
regionBroker.getDestinationStatistics().getInflight().getCount());
-                return 
regionBroker.getDestinationStatistics().getDequeues().getCount() == dequeue
-                        && 
regionBroker.getDestinationStatistics().getInflight().getCount() == inflight;
+                long actualDeq = 0;
+                long actualInflight = 0;
+                for (ActiveMQTopic topic : topics) {
+                    ActiveMQTopic advisory = 
AdvisorySupport.getConsumerAdvisoryTopic(topic);

Review Comment:
   The point is that sometimes it's failing because on the global statistics we 
get advisory (nob statistics). So because the test is focused into testing 
statistics for one destination only, I changed it to match more closely what's 
the test is about.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to