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 3ed4a9c2c29458f06c782a08b445196713b9b38b 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 e925c8c9204..fa1dd2489b7 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 @@ -508,8 +508,11 @@ public class ResendRequestTest extends BrokerTestBase { } // 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;
