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

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

commit 27133222c856027e7bfd8588815c76f73692e105
Author: Matteo Merli <[email protected]>
AuthorDate: Tue Apr 21 15:54:17 2026 -0700

    [fix][test] Recreate EventLoop in PublishRateLimiterTest setup (#25560)
    
    (cherry picked from commit 293eafc08c933bbb4ffebb37c128c4b76b6a3947)
---
 .../org/apache/pulsar/broker/service/PublishRateLimiterTest.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PublishRateLimiterTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PublishRateLimiterTest.java
index 270286419f7..03283865761 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PublishRateLimiterTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PublishRateLimiterTest.java
@@ -57,11 +57,12 @@ public class PublishRateLimiterTest {
     private ServerCnx serverCnx;
     private PublishRateLimiterImpl publishRateLimiter;
     private ServerCnxThrottleTracker throttleTracker;
-    private DefaultThreadFactory threadFactory = new 
DefaultThreadFactory("pulsar-io");
-    private EventLoop eventLoop = new DefaultEventLoop(threadFactory);
+    private final DefaultThreadFactory threadFactory = new 
DefaultThreadFactory("pulsar-io");
+    private EventLoop eventLoop;
 
     @BeforeMethod
     public void setup() throws Exception {
+        eventLoop = new DefaultEventLoop(threadFactory);
         policies.publishMaxMessageRate = new HashMap<>();
         policies.publishMaxMessageRate.put(CLUSTER_NAME, publishRate);
         manualClockSource = new AtomicLong(TimeUnit.SECONDS.toNanos(100));

Reply via email to