This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ab09413c8b [fix][test] Stabilize 
testSecondaryIsolationGroupsBookiesNegative() test (#25900)
7ab09413c8b is described below

commit 7ab09413c8bccaa759ce5efcd187cd8e7bd81580
Author: Oneby Wang <[email protected]>
AuthorDate: Thu Jun 4 03:50:24 2026 +0800

    [fix][test] Stabilize testSecondaryIsolationGroupsBookiesNegative() test 
(#25900)
---
 .../rackawareness/IsolatedBookieEnsemblePlacementPolicyTest.java    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/pulsar-broker-common/src/test/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicyTest.java
 
b/pulsar-broker-common/src/test/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicyTest.java
index cd5041de459..0ea4ab94a5d 100644
--- 
a/pulsar-broker-common/src/test/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicyTest.java
+++ 
b/pulsar-broker-common/src/test/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicyTest.java
@@ -590,6 +590,12 @@ public class IsolatedBookieEnsemblePlacementPolicyTest {
                 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();

Reply via email to