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 55e6022f2a1 [fix][test] Add timeout to initial receives in 
ResendRequestTest.testSharedSingleAckedPartitionedTopic (#25828)
55e6022f2a1 is described below

commit 55e6022f2a12cd775f90e09a8756feb02dd2b1b0
Author: Matteo Merli <[email protected]>
AuthorDate: Wed May 20 00:59:49 2026 -0700

    [fix][test] Add timeout to initial receives in 
ResendRequestTest.testSharedSingleAckedPartitionedTopic (#25828)
---
 .../java/org/apache/pulsar/broker/service/ResendRequestTest.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
index f290e707f77..4292b9236c8 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
@@ -513,8 +513,11 @@ public class ResendRequestTest extends 
SharedPulsarBaseTest {
         }
 
         // 4. Receive messages
-        Message<byte[]> message1 = consumer1.receive();
-        Message<byte[]> message2 = consumer2.receive();
+        // Use timeouts on the initial receives — with a Shared subscription 
the broker may
+        // dispatch all messages to a single consumer (receiverQueueSize is 
larger than the
+        // number of messages per partition), and a blocking receive() would 
hang.
+        Message<byte[]> message1 = consumer1.receive(5000, 
TimeUnit.MILLISECONDS);
+        Message<byte[]> message2 = consumer2.receive(5000, 
TimeUnit.MILLISECONDS);
         int messageCount1 = 0;
         int messageCount2 = 0;
         int ackCount1 = 0;

Reply via email to