oneby-wang opened a new pull request, #25900:
URL: https://github.com/apache/pulsar/pull/25900

   ### Motivation
   
   `testSecondaryIsolationGroupsBookiesNegative()` is flaky because the test 
calls newEnsemble immediately after initializing 
IsolatedBookieEnsemblePlacementPolicy. The policy loads the bookie rack 
metadata cache asynchronously. If the first newEnsemble call races with the 
initial cache load, cachedRackConfiguration can still be empty and the 
isolation filtering is skipped, so the ensemble may be created successfully 
instead of throwing BKNotEnoughBookiesException.
   
   The test is intended to verify the negative fallback path for secondary 
isolation groups: when the primary group does not have enough available bookies 
and the configured secondary group is absent from rack metadata, the policy 
must not fall back to default-group bookies, so creating an ensemble of size 3 
should fail.
   
   ### Modifications
   
   Add an Awaitility guard before calling newEnsemble so the test waits until 
the async bookie rack metadata cache load triggered by initialize() is visible. 
This matches the pattern used by nearby tests and keeps the production 
placement policy behavior unchanged.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to