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 3ce94cb7510 [fix][test] Fix flaky
BookieClientsStatsGeneratorTest.testBookieClientStatsGenerator (#25646)
3ce94cb7510 is described below
commit 3ce94cb75103188451fd8a1cbf88049e31c5d89b
Author: Matteo Merli <[email protected]>
AuthorDate: Fri May 1 10:33:25 2026 -0700
[fix][test] Fix flaky
BookieClientsStatsGeneratorTest.testBookieClientStatsGenerator (#25646)
---
.../pulsar/broker/stats/BookieClientsStatsGeneratorTest.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
index d5924ecb510..21b431cb751 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
@@ -19,7 +19,7 @@
package org.apache.pulsar.broker.stats;
import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertNotNull;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import java.util.Map;
@@ -34,10 +34,13 @@ public class BookieClientsStatsGeneratorTest extends
SharedPulsarBaseTest {
@Test
public void testBookieClientStatsGenerator() throws Exception {
- // should not generate any NPE or other exceptions..
+ // The intent of this test is just to verify that generate() does not
throw
+ // (NPE, etc.). The previous emptiness assertion only held when each
test class
+ // got a fresh broker; on the shared cluster prior tests have already
exercised
+ // BookKeeper, so stats may be non-empty.
Map<String, Map<String, PendingBookieOpsStats>> stats =
BookieClientStatsGenerator.generate(SharedPulsarCluster.get().getPulsarService());
- assertTrue(stats.isEmpty());
+ assertNotNull(stats);
}
@Test