[fix][test] Stabilize testSecondaryIsolationGroupsBookiesNegative() test#25900
Open
oneby-wang wants to merge 1 commit into
Open
[fix][test] Stabilize testSecondaryIsolationGroupsBookiesNegative() test#25900oneby-wang wants to merge 1 commit into
oneby-wang wants to merge 1 commit into
Conversation
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
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
Does this pull request potentially affect one of the following parts: