walterddr commented on code in PR #8538:
URL: https://github.com/apache/pinot/pull/8538#discussion_r851349057


##########
pinot-plugins/pinot-stream-ingestion/pinot-pulsar/src/test/java/org/apache/pinot/plugin/stream/pulsar/PulsarConsumerTest.java:
##########
@@ -273,13 +269,31 @@ public void testPartitionLevelConsumerBatchMessages()
     }
   }
 
-  public MessageId getMessageIdForPartitionAndIndex(int partitionNum, int 
index) {
+  private static MessageBatch consumeMessageBatch(PartitionGroupConsumer 
consumer, MessageId startMsgId,
+      MessageId endMsgId, int expectedMsgCount)
+      throws TimeoutException {
+    int retryCount = 0;
+    MessageBatch messageBatch = null;
+    while (retryCount < DEFAULT_RETRY_COUNT) {
+      retryCount++;
+      messageBatch = consumer.fetchMessages(new 
MessageIdStreamOffset(startMsgId),

Review Comment:
   according to the documentation 
https://pulsar.apache.org/api/client/org/apache/pulsar/client/api/Producer.html 
   - producer.flush() should wait until all the message finish publishing 
before returning (or throw exception); thus we can't check on the producer side
   - only way to check and wait for all records reaches pulsar for consumption 
is to actually consume -- which is exactly what this test is doing. 
    
   so I guess we should do is wrap the test with 
   ```
   TestUtils.waitForCondition(aVoid -> { 
     // consume and assert 
   }, timeoutMs, "")
   ```
   
   sounds good?



-- 
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-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to