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

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

commit 981bef6bdde7db688ef955fb734f60e0d4d5c45c
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)
    
    (cherry picked from commit 55e6022f2a12cd775f90e09a8756feb02dd2b1b0)
---
 .../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 5bc3e7e9480..7ffec5933d7 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
@@ -514,8 +514,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