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/18 11:13:22 UTC
[GitHub] [pulsar] nicoloboschi opened a new pull request, #17161: [fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs
nicoloboschi opened a new pull request, #17161:
URL: https://github.com/apache/pulsar/pull/17161
### Motivation
```
java.lang.AssertionError: expected [600] but found [265]
at org.testng.Assert.fail(Assert.java:99)
at org.testng.Assert.failNotEquals(Assert.java:1037)
at org.testng.Assert.assertEqualsImpl(Assert.java:140)
at org.testng.Assert.assertEquals(Assert.java:122)
at org.testng.Assert.assertEquals(Assert.java:907)
at org.testng.Assert.assertEquals(Assert.java:917)
at org.apache.pulsar.client.api.DispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs(DispatcherBlockConsumerTest.java:1036)
```
### Modifications
In the scope of this test is important to not group acks because the ack for messages may 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 and the test will fail.
- Set acknowledgmentGroupTime to 0 for the consumer
- Moved the test to the `broker` suite (it was `flaky`)
- [x] `doc-not-needed`
--
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
[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #17161: [fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [pulsar] nicoloboschi commented on pull request #17161: [fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs
Posted by GitBox <gi...@apache.org>.
nicoloboschi commented on PR #17161:
URL: https://github.com/apache/pulsar/pull/17161#issuecomment-1232049182
@eolivelli see my response https://github.com/apache/pulsar/pull/17161#discussion_r958831120
--
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
[GitHub] [pulsar] nicoloboschi merged pull request #17161: [fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs
Posted by GitBox <gi...@apache.org>.
nicoloboschi merged PR #17161:
URL: https://github.com/apache/pulsar/pull/17161
--
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
[GitHub] [pulsar] eolivelli commented on a diff in pull request #17161: [fix][test] Fix flaky test: PersistentStreamingDispatcherBlockConsumerTest.testBrokerDispatchBlockAndSubAckBackRequiredMsgs
Posted by GitBox <gi...@apache.org>.
eolivelli commented on code in PR #17161:
URL: https://github.com/apache/pulsar/pull/17161#discussion_r953699041
##########
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:
Using ackReceiptEnable can help as well.
Because you cam wait for the server to process the ack
--
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