[fix][test] Reduce flakiness in testLoadBalancerServiceUnitTableViewSyncer#25638
Merged
lhotari merged 1 commit intoapache:masterfrom May 1, 2026
Merged
Conversation
…yncer Restructure the test so it stops chasing timing bugs: - Activate/deactivate the syncer by calling primaryLoadManager.monitor() directly instead of forcing leader transitions via makeSecondaryAsLeader() + makePrimaryAsLeader(). The double transition serializes playLeader() behind a still-running playFollower() on the single-threaded loadManagerExecutor, which was the root cause of repeated 30s+ timeouts (the 60s bumps in apache#25596 / apache#25427 / apache#25378 were treating that symptom). - Drop pulsar4. The original test added two extra brokers but only one of them (pulsar3 in the metadata-store parametrization, pulsar4 in the system-topic parametrization) ever exercised the cross-impl syncer path; the other was redundant. Always use pulsar3 with the OTHER table view impl so both parametrizations get equivalent coverage from half the cluster work. - Restore the 30s Awaitility timeouts; with monitor() driving syncer state synchronously, the longer 60s budgets are no longer needed. - Reorganize into explicit phases (activate, cross-impl lookup, disconnect, re-register, deactivate) with the durability check on the SLA monitor topic preserved. Net: 113 insertions(+), 235 deletions(-). Six consecutive local runs pass cleanly across both parametrizations.
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.
Summary
Restructure
testLoadBalancerServiceUnitTableViewSyncerto stop chasing timing bugs.primaryLoadManager.monitor()directly instead of forcing leader transitions viamakeSecondaryAsLeader() + makePrimaryAsLeader(). The double transition serializesplayLeader()behind a still-runningplayFollower()on the single-threadedloadManagerExecutor, which was the root cause of repeated 30s+ timeouts. The 60s Awaitility bumps in [fix][test] Fix flaky ExtensibleLoadManagerImplTest.testLoadBalancerServiceUnitTableViewSyncer #25596 / [fix][test] Fix flaky testLoadBalancerServiceUnitTableViewSyncer #25427 / [fix][test] Fix flaky ExtensibleLoadManagerImplTest.testLoadBalancerServiceUnitTableViewSyncer #25378 were treating that symptom; callingmonitor()(the same hook the periodic scheduler uses) makes activation deterministic and synchronous.persistent://pulsar/system/loadbalancer-service-unit-state.monitor()driving syncer state synchronously, the longer 60s budgets are no longer needed.Net: 113 insertions(+), 235 deletions(-).
Test plan
serviceUnitStateTableViewClassNameparametrizations