zooo-code commented on code in PR #25158:
URL: https://github.com/apache/pulsar/pull/25158#discussion_r2704973904
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java:
##########
@@ -3429,6 +3429,36 @@ public void testCreateAndDeleteNamespaceWithBundles()
throws Exception {
deleteNamespaceWithRetry(ns, false);
}
+ @Test
+ public void testGetNamespacePoliciesSyncAsyncBundlesConsistency() throws
Exception {
Review Comment:
@lhotari Thanks for the feedback!
I've updated the test to `testGetNamespacePoliciesAsyncReflectsBundleSplit`.
This test explicitly verifies that `getPoliciesAsync` returns the latest
bundles from `NamespaceBundleFactory` after a bundle split:
1. Create namespace with 1 bundle
2. Split the bundle → 2 bundles
3. Verify `getPoliciesAsync()` returns 2 bundles
**Before the fix**: `LocalPolicies.bundles` would still show 1 bundle (stale
data) → test fails
**After the fix**: `NamespaceBundleFactory.getBundlesAsync()` provides the
latest 2 bundles → test passes
This approach verifies the actual behavior change rather than just comparing
sync/async consistency, which would pass even before the fix.
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java:
##########
@@ -3429,6 +3429,36 @@ public void testCreateAndDeleteNamespaceWithBundles()
throws Exception {
deleteNamespaceWithRetry(ns, false);
}
+ @Test
+ public void testGetNamespacePoliciesSyncAsyncBundlesConsistency() throws
Exception {
Review Comment:
@lhotari
I've updated the test to `testGetNamespacePoliciesAsyncReflectsBundleSplit`.
This test explicitly verifies that `getPoliciesAsync` returns the latest
bundles from `NamespaceBundleFactory` after a bundle split:
1. Create namespace with 1 bundle
2. Split the bundle → 2 bundles
3. Verify `getPoliciesAsync()` returns 2 bundles
**Before the fix**: `LocalPolicies.bundles` would still show 1 bundle (stale
data) → test fails
**After the fix**: `NamespaceBundleFactory.getBundlesAsync()` provides the
latest 2 bundles → test passes
This approach verifies the actual behavior change rather than just comparing
sync/async consistency, which would pass even before the fix.
--
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]