ShivsundarR commented on code in PR #18105: URL: https://github.com/apache/kafka/pull/18105#discussion_r1878011954
########## core/src/test/java/kafka/test/api/ShareConsumerTest.java: ########## @@ -1749,23 +1642,18 @@ public void testShareAutoOffsetResetEarliestAfterLsoMovement(String persister) t ProducerRecord<byte[], byte[]> record = new ProducerRecord<>(tp.topic(), tp.partition(), null, "key".getBytes(), "value".getBytes()); // We write 10 records to the topic, so they would be written from offsets 0-9 on the topic. - try { - for (int i = 0; i < 10; i++) { - producer.send(record).get(); - } - } catch (Exception e) { - fail("Failed to send records: " + e); + for (int i = 0; i < 10; i++) { + assertDoesNotThrow(() -> producer.send(record).get(), "Failed to send records"); Review Comment: Yeah this looks fine to me, as once we include the custom error message, we get both the stack trace of the exception and the custom message that we defined. -- 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