You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/30 19:01:45 UTC

[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #17161: [fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs

nicoloboschi commented on code in PR #17161:
URL: https://github.com/apache/pulsar/pull/17161#discussion_r958831120


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java:
##########
@@ -998,6 +999,11 @@ public void testBrokerDispatchBlockAndSubAckBackRequiredMsgs() {
              * maxUnAckPerDispatcher limit
              **/
             consumer1Sub2 = (ConsumerImpl<byte[]>) pulsarClient.newConsumer().topic(topicName)
+                    // in the scope of this test is important to not group acks because
+                    // the ack for messages happens after receiving a new message from the topic.
+                    // If the acks are sent in batch it may happen that the dispatcher is still blocked until
+                    // it receives the batched acks and the Consumer#receive will return null.
+                    .acknowledgmentGroupTime(0, TimeUnit.SECONDS)

Review Comment:
   @eolivelli `ackReceiptEnable` would also work but it slows down the test a lot (5 secs vs 1 min) so I'd prefer to disable the ack grouping. For the scope of the test this is irrelevant 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org