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
commit da9bcd1ec75fc4eff94709eba3e2da88a639577c Author: Matteo Merli <[email protected]> AuthorDate: Mon Jun 8 12:32:44 2026 -0700 [fix][test] Fix flaky ExtensibleLoadManagerImplTest by re-serving the channel topic in initializeState (#25976) --- .../extensions/ExtensibleLoadManagerImplBaseTest.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImplBaseTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImplBaseTest.java index 8f08b61015d..d483938c621 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImplBaseTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImplBaseTest.java @@ -199,16 +199,24 @@ public abstract class ExtensibleLoadManagerImplBaseTest extends MockedPulsarServ protected void initializeState() throws PulsarAdminException, IllegalAccessException { // After a prior test churned leader election, the channel-topic bundle can be left // unserved ("not served by this instance"), making the unload's channel publish fail - // (HTTP 500) or hang server-side until the background monitor task (120s interval) - // reconciles the brokers' roles with the channel ownership. Drive monitor() eagerly to - // heal that state, bound each unload attempt (a synchronous unload() can block longer - // than the whole retry window), and fail loudly on exhaustion. + // (HTTP 500) or hang server-side. monitor() only self-heals when there is *no* channel + // owner; it does NOT heal the case where an owner is recorded but the bundle is not + // actually served, so the unload below can never publish. Force-serve the channel topic + // each attempt: an admin lookup re-assigns the pulsar/system bundle and getStats makes + // the owner load the topic (the lookup layer alone can claim an owner that refuses to + // serve). Bound each unload attempt and fail loudly on exhaustion. + boolean systemTopicChannel = + serviceUnitStateTableViewClassName.equals(ServiceUnitStateTableViewImpl.class.getName()); Awaitility.await().atMost(120, TimeUnit.SECONDS) .pollInterval(1, TimeUnit.SECONDS) .ignoreExceptions() .untilAsserted(() -> { primaryLoadManager.monitor(); secondaryLoadManager.monitor(); + if (systemTopicChannel) { + admin.lookups().lookupTopic(ServiceUnitStateTableViewImpl.TOPIC); + admin.topics().getStats(ServiceUnitStateTableViewImpl.TOPIC); + } admin.namespaces().unloadAsync(defaultTestNamespace).get(15, TimeUnit.SECONDS); }); reset(primaryLoadManager, secondaryLoadManager);
