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/05/01 08:58:19 UTC

[GitHub] [pulsar] BewareMyPower commented on pull request #15406: [Java Client] Fix flaky BatchMessageTest by initializing lastBatchSendNanoTime

BewareMyPower commented on PR #15406:
URL: https://github.com/apache/pulsar/pull/15406#issuecomment-1114175051

   To explain my extra logs, `1 (0) 12 (600)` means there is 1 message and 12 bytes in the batch, while the number limit and size limit are 0 and 600 bytes.
   
   Before this patch, `BatchMessageTest` failed nearly each time in my local env.
   
   <img width="1260" alt="image" src="https://user-images.githubusercontent.com/18204803/166138957-c73e9a57-e4b4-44a9-bd89-e15dc6565544.png">
   
   I'm not sure whether this test class is ignored in CI so that CI could pass.
   
   After this patch, I've run the test for 3 times in a row and it always succeeded.
   
   <img width="1016" alt="image" src="https://user-images.githubusercontent.com/18204803/166139045-cf1b2947-63f2-4b3a-8282-271aa6dad881.png">
   
   I found https://github.com/apache/pulsar/pull/14968 also tried to fix this flaky test, please also take a look, @nodece 
   
   A simpler fix solution is calling `producer.flush()` in these tests so that the batch won't wait until the batch timer task is scheduled. But it will hide the bug that `lastBatchSendNanoTime` was not initialized.


-- 
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