This is an automated email from the ASF dual-hosted git repository.
bogong pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.9 by this push:
new 93b69cccee6 cherry-pick -x "1faf497"
93b69cccee6 is described below
commit 93b69cccee60857f380c2d00dc0f0a65e45ee773
Author: gaozhangmin <[email protected]>
AuthorDate: Sun Aug 21 10:01:22 2022 +0800
cherry-pick -x "1faf497"
---
.../java/org/apache/pulsar/broker/admin/AdminApi2Test.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java
index e0fac522f27..cf0ab1914f9 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java
@@ -1537,11 +1537,13 @@ public class AdminApi2Test extends
MockedPulsarServiceBaseTest {
producer.send("message-1".getBytes(StandardCharsets.UTF_8));
}
}
-
- TopicStats topicStats = admin.topics().getPartitionedStats(topic,
false, true, true);
-
assertEquals(topicStats.getSubscriptions().get(subName).getMsgBacklog(), 10);
-
assertEquals(topicStats.getSubscriptions().get(subName).getBacklogSize(), 440);
-
assertEquals(topicStats.getSubscriptions().get(subName).getMsgBacklogNoDelayed(),
5);
+ // wait until the message add to delay queue.
+ Awaitility.await().untilAsserted(() -> {
+ TopicStats topicStats = admin.topics().getPartitionedStats(topic,
false, true, true);
+
assertEquals(topicStats.getSubscriptions().get(subName).getMsgBacklog(), 10);
+
assertEquals(topicStats.getSubscriptions().get(subName).getBacklogSize(), 440);
+
assertEquals(topicStats.getSubscriptions().get(subName).getMsgBacklogNoDelayed(),
5);
+ });
for (int i = 0; i < 5; i++) {
consumer.acknowledge(consumer.receive());