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

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


The following commit(s) were added to refs/heads/branch-4.2 by this push:
     new 205f1252e22 [fix][test] Fix flaky 
ExtensibleLoadManagerTest.startBroker timeout (#25500)
205f1252e22 is described below

commit 205f1252e2234aa3d2f87283eb47049f849c34b4
Author: Lari Hotari <[email protected]>
AuthorDate: Thu Apr 9 11:17:29 2026 +0300

    [fix][test] Fix flaky ExtensibleLoadManagerTest.startBroker timeout (#25500)
    
    (cherry picked from commit 12bcd6bcc9e8379c49555b1d40e6103de9b26384)
---
 .../loadbalance/ExtensibleLoadManagerTest.java     | 55 ++++++++++++----------
 1 file changed, 31 insertions(+), 24 deletions(-)

diff --git 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java
 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java
index 90301a18617..33f72d7a2ad 100644
--- 
a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java
+++ 
b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java
@@ -135,33 +135,40 @@ public class ExtensibleLoadManagerTest extends 
TestRetrySupport {
 
     @BeforeMethod(alwaysRun = true)
     public void startBroker() {
-        if (pulsarCluster != null) {
-            pulsarCluster.getBrokers().forEach(brokerContainer -> {
-                if (!brokerContainer.isRunning()) {
-                    brokerContainer.start();
-                }
-            });
-            String topicName = "persistent://" + DEFAULT_NAMESPACE + 
"/startBrokerCheck";
-            Awaitility.await().atMost(120, 
TimeUnit.SECONDS).ignoreExceptions().until(
-                    () -> {
-                        for (BrokerContainer brokerContainer : 
pulsarCluster.getBrokers()) {
-                            try (PulsarAdmin admin = 
PulsarAdmin.builder().serviceHttpUrl(
-                                    
brokerContainer.getHttpServiceUrl()).build()) {
-                                if 
(admin.brokers().getActiveBrokers(clusterName).size() != NUM_BROKERS) {
-                                    return false;
-                                }
-                                try {
-                                    
admin.topics().createPartitionedTopic(topicName, 10);
-                                } catch 
(PulsarAdminException.ConflictException e) {
-                                    // expected
-                                }
-                                
admin.lookups().lookupPartitionedTopic(topicName);
+        if (pulsarCluster == null) {
+            return;
+        }
+        pulsarCluster.getBrokers().forEach(brokerContainer -> {
+            if (!brokerContainer.isRunning()) {
+                brokerContainer.start();
+            }
+        });
+        String topicName = "persistent://" + DEFAULT_NAMESPACE + 
"/startBrokerCheck";
+        Awaitility.await().atMost(180, TimeUnit.SECONDS).until(
+                () -> {
+                    for (BrokerContainer brokerContainer : 
pulsarCluster.getBrokers()) {
+                        try (PulsarAdmin brokerAdmin = 
PulsarAdmin.builder().serviceHttpUrl(
+                                brokerContainer.getHttpServiceUrl()).build()) {
+                            if 
(brokerAdmin.brokers().getActiveBrokers(clusterName).size() != NUM_BROKERS) {
+                                log.info("Broker {} does not see {} active 
brokers yet",
+                                        brokerContainer.getHostName(), 
NUM_BROKERS);
+                                return false;
+                            }
+                            try {
+                                
brokerAdmin.topics().createPartitionedTopic(topicName, 10);
+                            } catch (PulsarAdminException.ConflictException e) 
{
+                                // expected - topic already exists
                             }
+                            
brokerAdmin.lookups().lookupPartitionedTopic(topicName);
+                        } catch (Exception e) {
+                            log.warn("Broker {} is not ready yet: {}",
+                                    brokerContainer.getHostName(), 
e.getMessage());
+                            return false;
                         }
-                        return true;
                     }
-            );
-        }
+                    return true;
+                }
+        );
     }
 
     @Test(timeOut = 40 * 1000)

Reply via email to