From 7da7c9fc14cef348cd7bba45ddd89d6829ba9704 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Fri, 7 Oct 2022 17:23:06 +0800 Subject: [PATCH] [fix][broker]unify time unit at dropping the backlog on a topic --- .../pulsar/broker/service/BacklogQuotaManagerTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java index 9b45c0082e944f..e60486b3441824 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java @@ -111,7 +111,7 @@ void setup() throws Exception { config.setBrokerServicePort(Optional.of(0)); config.setAuthorizationEnabled(false); config.setAuthenticationEnabled(false); - config.setBacklogQuotaCheckIntervalInSeconds(TIME_TO_CHECK_BACKLOG_QUOTA / 2); + config.setBacklogQuotaCheckIntervalInSeconds(TIME_TO_CHECK_BACKLOG_QUOTA); config.setManagedLedgerMaxEntriesPerLedger(MAX_ENTRIES_PER_LEDGER); config.setManagedLedgerMinLedgerRolloverTimeMinutes(0); config.setAllowAutoTopicCreationType("non-partitioned"); @@ -528,7 +528,7 @@ public void testConsumerBacklogEvictionTimeQuota() throws Exception { } @Test(timeOut = 60000) - public void testConsumerBacklogEvictionTimeQuotaWithoutEviction() throws Exception { + public void testConsumerBacklogEvictionTimeQuotaWithPartEviction() throws Exception { assertEquals(admin.namespaces().getBacklogQuotaMap("prop/ns-quota"), new HashMap<>()); admin.namespaces().setBacklogQuota("prop/ns-quota", @@ -559,7 +559,7 @@ public void testConsumerBacklogEvictionTimeQuotaWithoutEviction() throws Excepti assertEquals(stats.getSubscriptions().get(subName2).getMsgBacklog(), 5); // Sleep 5000 mills for first 5 messages. - Thread.sleep(5000l); + Thread.sleep(5000L); numMsgs = 9; for (int i = 0; i < numMsgs; i++) { producer.send(content); @@ -568,7 +568,7 @@ public void testConsumerBacklogEvictionTimeQuotaWithoutEviction() throws Excepti } // The first 5 messages are expired after sleeping 2000 more mills. - Thread.sleep(2000l); + Thread.sleep(2000L); rolloverStats(); TopicStats stats2 = getTopicStats(topic1);