Skip to content

[fix][test] Stabilize testSecondaryIsolationGroupsBookiesNegative() test#25900

Open
oneby-wang wants to merge 1 commit into
apache:masterfrom
oneby-wang:testSecondaryIsolationGroupsBookiesNegative_flaky_fix
Open

[fix][test] Stabilize testSecondaryIsolationGroupsBookiesNegative() test#25900
oneby-wang wants to merge 1 commit into
apache:masterfrom
oneby-wang:testSecondaryIsolationGroupsBookiesNegative_flaky_fix

Conversation

@oneby-wang
Copy link
Copy Markdown
Contributor

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

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant