apoorvmittal10 commented on code in PR #18105:
URL: https://github.com/apache/kafka/pull/18105#discussion_r1876860865
##########
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:
Will it be possible to capture the exception thrown as well so it's easy to
find what went wrong. It's hard to find that with the current custom error
message?
--
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]