gaozhangmin commented on a change in pull request #14000:
URL: https://github.com/apache/pulsar/pull/14000#discussion_r803501581



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
##########
@@ -475,10 +477,12 @@ public void testConsumerBacklogEvictionTimeQuota() throws 
Exception {
         rolloverStats();
 
         stats = admin.topics().getStats(topic1);
+        PersistentTopic topic1Reference = (PersistentTopic) 
pulsar.getBrokerService().getTopicReference(topic1).get();
+        ManagedLedgerImpl ml = (ManagedLedgerImpl) 
topic1Reference.getManagedLedger();
         // Messages on first 2 ledgers should be expired, backlog is number of
-        // message in current ledger which should be 4.
-        assertEquals(stats.getSubscriptions().get(subName1).getMsgBacklog(), 
4);
-        assertEquals(stats.getSubscriptions().get(subName2).getMsgBacklog(), 
4);
+        // message in current ledger.
+        assertEquals(stats.getSubscriptions().get(subName1).getMsgBacklog(), 
ml.getNumberOfEntries());

Review comment:
       Yes, getCurrentLedgerEntries is more precise @Jason918 




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


Reply via email to