[fix][test] Reduce admin client churn in ExtensibleLoadManagerTest.startBroker - #25676
Merged
merlimat merged 1 commit intoMay 5, 2026
Conversation
…artBroker The @BeforeMethod startBroker() polled readiness by creating a new PulsarAdmin instance per broker on every poll iteration (3 brokers x N polls of build/close). When earlier tests stopped brokers (testStopBroker, testIsolationPolicy), the brokers in the next method's startBroker() are still warming up, and the per-tick connection setup contends with that warmup. Build the per-broker PulsarAdmin clients once before the await loop and reuse them across all poll iterations, closing them in a finally block. The readiness checks themselves (getActiveBrokers / createPartitioned- Topic / lookupPartitionedTopic) are unchanged.
lhotari
approved these changes
May 5, 2026
11 tasks
11 tasks
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ExtensibleLoadManagerTest.startBrokeris a@BeforeMethodthat runs before each test method (e.g.testStopBroker,testIsolationPolicy) to make sure all brokers are running and ready. Some test methods intentionally stop brokers, so the next method'sstartBrokerwaits for those brokers to come back.The readiness check polled by creating a brand new
PulsarAdminper broker on every poll iteration:That's 3 brokers × N polls of admin builder/close, each one establishing a new HTTP client. The connection setup work piles up against brokers that are still warming up after a stop/restart and the await can exhaust its 180s budget.
Example failure: https://scans.gradle.com/s/4dgsnjrtxayqa/tests/task/:tests:integration:integrationTest/details/org.apache.pulsar.tests.integration.loadbalance.ExtensibleLoadManagerTest/startBroker?top-execution=1
Modifications
Build the per-broker
PulsarAdminclients once before the await loop and reuse them across all poll iterations. Close them in afinallyblock. The readiness checks themselves (getActiveBrokers,createPartitionedTopic,lookupPartitionedTopic) are unchanged.Verifying this change
This change is already covered by the existing
ExtensibleLoadManagerTestintegration test (which runsstartBrokerbetween every test method).Does this pull request potentially affect one of the following parts: