Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ public void testSecondaryIsolationGroupsBookiesNegative() throws Exception {
NullStatsLogger.INSTANCE, BookieSocketAddress.LEGACY_BOOKIEID_RESOLVER);
isolationPolicy.onClusterChanged(writableBookies, readOnlyBookies);

// Wait for the async cache load triggered by initialize() to complete; otherwise the
// first newEnsemble call can race with an empty cachedRackConfiguration and skip isolation.
Awaitility.await().atMost(Duration.ofSeconds(5)).untilAsserted(() ->
assertNotNull(isolationPolicy.getBookieMappingCache()
.getIfCached(BookieRackAffinityMapping.BOOKIE_INFO_ROOT_PATH)));

try {
isolationPolicy
.newEnsemble(3, 3, 2, Collections.emptyMap(), new HashSet<>()).getResult();
Expand Down