You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/04/22 07:44:18 UTC

(pulsar) branch branch-4.1 updated (c1548fe4ae9 -> c12dcf6feef)

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a change to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git


    from c1548fe4ae9 [fix][broker] Lower log level of DrainingHashesTracker not-found entry to DEBUG (#25558)
     new e53128d8305 [fix][test] Fix flaky BrokerRegistryIntegrationTest port binding race (#25463)
     new c12dcf6feef [fix] Fix flaky testEstimatedTimeBasedBacklogQuotaCheckWhenNoBacklog (#25307)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../loadbalance/extensions/BrokerRegistryIntegrationTest.java    | 9 +++++----
 .../service/persistent/PersistentTopicProtectedMethodsTest.java  | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)


(pulsar) 02/02: [fix] Fix flaky testEstimatedTimeBasedBacklogQuotaCheckWhenNoBacklog (#25307)

Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit c12dcf6feef6f0d7eed23d5727d14eda2535cd1d
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Wed Mar 11 01:42:48 2026 -0700

    [fix] Fix flaky testEstimatedTimeBasedBacklogQuotaCheckWhenNoBacklog (#25307)
    
    (cherry picked from commit 6c357f6c909ba56382669e5619d91abd5dc17816)
---
 .../service/persistent/PersistentTopicProtectedMethodsTest.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicProtectedMethodsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicProtectedMethodsTest.java
index bba0d2050d8..e51da48042e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicProtectedMethodsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicProtectedMethodsTest.java
@@ -92,7 +92,9 @@ public class PersistentTopicProtectedMethodsTest extends ProducerConsumerBase {
         admin.topics().skipAllMessages(tp, "s1");
         Awaitility.await().untilAsserted(() -> {
             assertEquals(cursor.getNumberOfEntriesInBacklog(true), 0);
-            assertEquals(cursor.getMarkDeletedPosition(), ml.getLastConfirmedEntry());
+            // Use >= comparison: after skipAll, a ledger rollover may create a new empty ledger,
+            // moving the cursor's mark-delete position past the LAC (e.g., 10:-1 vs 9:1).
+            assertTrue(cursor.getMarkDeletedPosition().compareTo(ml.getLastConfirmedEntry()) >= 0);
         });
         CompletableFuture completableFuture = new CompletableFuture();
         ml.trimConsumedLedgersInBackground(completableFuture);
@@ -100,7 +102,7 @@ public class PersistentTopicProtectedMethodsTest extends ProducerConsumerBase {
         Awaitility.await().untilAsserted(() -> {
             assertEquals(ml.getLedgersInfo().size(), 1);
             assertEquals(cursor.getNumberOfEntriesInBacklog(true), 0);
-            assertEquals(cursor.getMarkDeletedPosition(), ml.getLastConfirmedEntry());
+            assertTrue(cursor.getMarkDeletedPosition().compareTo(ml.getLastConfirmedEntry()) >= 0);
         });
 
         // Verify: "persistentTopic.estimatedTimeBasedBacklogQuotaCheck" will not get a NullPointerException.


(pulsar) 01/02: [fix][test] Fix flaky BrokerRegistryIntegrationTest port binding race (#25463)

Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit e53128d8305443a52968d621d9b9ca4a64c11828
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Mon Apr 6 19:47:23 2026 -0700

    [fix][test] Fix flaky BrokerRegistryIntegrationTest port binding race (#25463)
    
    (cherry picked from commit aaf2defe4bad3fc06a080718b53599bd2aeb4333)
---
 .../loadbalance/extensions/BrokerRegistryIntegrationTest.java    | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/BrokerRegistryIntegrationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/BrokerRegistryIntegrationTest.java
index e975671fa12..588b1c7730e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/BrokerRegistryIntegrationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/BrokerRegistryIntegrationTest.java
@@ -23,7 +23,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.bookkeeper.util.PortManager;
 import org.apache.pulsar.broker.PulsarService;
 import org.apache.pulsar.broker.ServiceConfiguration;
 import org.apache.pulsar.broker.loadbalance.LoadManager;
@@ -41,14 +40,14 @@ import org.testng.annotations.Test;
 public class BrokerRegistryIntegrationTest {
 
     private static final String clusterName = "test";
-    private final int zkPort = PortManager.nextFreePort();
-    private final LocalBookkeeperEnsemble bk = new LocalBookkeeperEnsemble(2, zkPort, PortManager::nextFreePort);
+    private LocalBookkeeperEnsemble bk;
     private PulsarService pulsar;
     private BrokerRegistry brokerRegistry;
     private String brokerMetadataPath;
 
     @BeforeClass
     protected void setup() throws Exception {
+        bk = new LocalBookkeeperEnsemble(2, 0, () -> 0);
         bk.start();
         pulsar = new PulsarService(brokerConfig());
         pulsar.start();
@@ -68,7 +67,9 @@ public class BrokerRegistryIntegrationTest {
             pulsar.close();
         }
         final var elapsedMs = System.currentTimeMillis() - startMs;
-        bk.stop();
+        if (bk != null) {
+            bk.stop();
+        }
         if (elapsedMs > 5000) {
             throw new RuntimeException("Broker took " + elapsedMs + "ms to close");
         }