Jason918 commented on code in PR #16837:
URL: https://github.com/apache/pulsar/pull/16837#discussion_r932014829
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ProducerMemoryLimitTest.java:
##########
@@ -69,6 +69,35 @@ public void testProducerTimeoutMemoryRelease() throws
Exception {
}
+ @Test(timeOut = 10_000)
+ public void testProducerBatchSendTimeoutMemoryRelease() throws Exception {
+ initClientWithMemoryLimit();
+ @Cleanup
+ ProducerImpl<byte[]> producer = (ProducerImpl<byte[]>)
pulsarClient.newProducer()
+ .topic("testProducerMemoryLimit")
+ .sendTimeout(5, TimeUnit.SECONDS)
+ .maxPendingMessages(0)
+ .enableBatching(true)
+ .batchingMaxPublishDelay(100, TimeUnit.MILLISECONDS)
+ .batchingMaxBytes(12)
+ .create();
+ this.stopBroker();
+ try {
+
producer.newMessage().value("memory-test".getBytes(StandardCharsets.UTF_8)).sendAsync();
+ try {
+
producer.newMessage().value("memory-test".getBytes(StandardCharsets.UTF_8)).sendAsync().get();
Review Comment:
This seems not be able cover the case in `batchMessageAndSend`
--
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]