Skip to content

[fix][test] Fix flaky ExtensibleLoadManagerImplTest.testLoadBalancerServiceUnitTableViewSyncer - #25378

Merged
lhotari merged 1 commit into
apache:masterfrom
merlimat:fix/flaky-ExtensibleLoadManagerImplTest-syncer
Mar 21, 2026
Merged

[fix][test] Fix flaky ExtensibleLoadManagerImplTest.testLoadBalancerServiceUnitTableViewSyncer#25378
lhotari merged 1 commit into
apache:masterfrom
merlimat:fix/flaky-ExtensibleLoadManagerImplTest-syncer

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Flaky test failure

org.awaitility.core.ConditionTimeoutException: Assertion condition expected [true] but found [false] within 10 seconds.
	at org.apache.pulsar.broker.loadbalance.extensions.ExtensibleLoadManagerImplTest.testLoadBalancerServiceUnitTableViewSyncer(ExtensibleLoadManagerImplTest.java:1324)

Summary

  • Fix flaky ExtensibleLoadManagerImplTest.testLoadBalancerServiceUnitTableViewSyncer by making it deterministic instead of time-dependent.
  • The test updates the loadBalancerServiceUnitTableViewSyncer dynamic config and immediately triggers leader transitions. If the config hasn't propagated to the broker's ServiceConfiguration by the time the leader callback fires, isLoadBalancerServiceUnitTableViewSyncerEnabled() returns false and the syncer is never activated — causing the 10s Awaitility timeout to expire.
  • Fix by explicitly waiting for the dynamic config to propagate to both brokers (by polling isLoadBalancerServiceUnitTableViewSyncerEnabled()) before triggering leader transitions. This ensures the leader callback sees the updated config and activates the syncer deterministically.
  • Apply the same pattern to the cleanup section where the config is deleted.

Documentation

  • doc-not-needed
    (Your PR doesn't need any doc update)

Matching PR in forked repository

No response

Tip

Add the labels ready-to-test and area/test to trigger the CI.

…erviceUnitTableViewSyncer

The test updates the loadBalancerServiceUnitTableViewSyncer dynamic
config and immediately triggers leader transitions. If the config
hasn't propagated to the broker's ServiceConfiguration by the time
the leader callback fires, isLoadBalancerServiceUnitTableViewSyncerEnabled()
returns false and the syncer is never activated.

Fix by waiting for the dynamic config to propagate to both brokers
before triggering leader transitions. This ensures the leader callback
sees the updated config and activates the syncer deterministically.

Also apply the same pattern to the cleanup section where the config
is deleted.
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Mar 20, 2026
@codecov-commenter

codecov-commenter commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.70%. Comparing base (a3ae705) to head (ac62d51).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #25378      +/-   ##
============================================
+ Coverage     72.52%   72.70%   +0.18%     
+ Complexity    34275    33852     -423     
============================================
  Files          1927     1954      +27     
  Lines        154339   154791     +452     
  Branches      17683    17730      +47     
============================================
+ Hits         111935   112544     +609     
+ Misses        33389    33208     -181     
- Partials       9015     9039      +24     
Flag Coverage Δ
inttests 25.76% <ø> (-0.28%) ⬇️
systests 22.56% <ø> (?)
unittests 73.67% <ø> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 168 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lhotari
lhotari merged commit 4e7ee94 into apache:master Mar 21, 2026
102 of 106 checks passed
@merlimat
merlimat deleted the fix/flaky-ExtensibleLoadManagerImplTest-syncer branch March 21, 2026 00:05
@lhotari lhotari added this to the 4.2.0 milestone Mar 24, 2026
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…erviceUnitTableViewSyncer (#25378)

(cherry picked from commit 4e7ee94)
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…erviceUnitTableViewSyncer (#25378)

(cherry picked from commit 4e7ee94)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2026
…erviceUnitTableViewSyncer (apache#25378)

(cherry picked from commit 4e7ee94)
(cherry picked from commit c71ccc7)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants