ShivsundarR commented on code in PR #18105:
URL: https://github.com/apache/kafka/pull/18105#discussion_r1878001330


##########
core/src/test/java/kafka/test/api/ShareConsumerTest.java:
##########
@@ -1819,17 +1706,12 @@ private CompletableFuture<Integer> produceMessages(int 
messageCount) {
                 recordFutures[i] = producer.send(record);
             }
             for (int i = 0; i < messageCount; i++) {
-                try {
-                    recordFutures[i].get();
-                    messagesSent++;
-                } catch (Exception e) {
-                    fail("Failed to send record: " + e);
-                }
+                final int index = i;
+                assertDoesNotThrow(() -> recordFutures[index].get());

Review Comment:
   Here, can we add the custom error message("Failed to send record") to the 
assert as well.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to