poorbarcode commented on code in PR #18491:
URL: https://github.com/apache/pulsar/pull/18491#discussion_r1024337980
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/NegativeAcksTest.java:
##########
@@ -439,4 +443,61 @@ public void run() {
Assert.assertEquals(count, 9);
Assert.assertEquals(0, datas.size());
}
+
+ /**
+ * see https://github.com/apache/pulsar/pull/18491
+ */
+ @Test
+ public void testMultiTopicConsumerConcurrentRedeliverAndReceive() throws
Exception {
Review Comment:
Already add a sleep before receiving messages.
I have tried to increase the probability of test failure, but can't get to
100%. Because that:
- method `receiveMessageFromConsumer` will call
`consumerImpl.batchReceiveAsync` and `consumerImpl.receiveAsync` .
- When `consumerImpl.batchReceiveAsync` and `consumerImpl.receiveAsync` is
finished, it will trigger another `receiveMessageFromConsumer`.
- `consumerImpl.batchReceiveAsync` and `consumerImpl.receiveAsync` calls
each other
- if receive messages is empty call `consumerImpl.receiveAsync`
- else call `consumerImpl.batchReceiveAsync`
- `consumerImpl.batchReceiveAsync` and `consumerImpl.receiveAsync` executed
asynchronously.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]