[ 
https://issues.apache.org/jira/browse/BEAM-14413?focusedWorklogId=767429&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-767429
 ]

ASF GitHub Bot logged work on BEAM-14413:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/May/22 22:03
            Start Date: 06/May/22 22:03
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on code in PR #17565:
URL: https://github.com/apache/beam/pull/17565#discussion_r867240848


##########
sdks/java/io/kafka/src/test/java/org/apache/beam/sdk/io/kafka/KafkaIOTest.java:
##########
@@ -1233,6 +1240,31 @@ public void testUnboundedSourceMetrics() {
         commitsEnqueuedMetrics.getCounters().iterator().next().getAttempted(), 
greaterThan(0L));
   }
 
+  @Test
+  public void testUnboundedReaderLogsCommitFailure() throws Exception {
+
+    List<String> topics = ImmutableList.of("topic_a");
+
+    PositionErrorConsumerFactory positionErrorConsumerFactory = new 
PositionErrorConsumerFactory();
+
+    UnboundedSource<KafkaRecord<Integer, Long>, KafkaCheckpointMark> source =
+        KafkaIO.<Integer, Long>read()
+            .withBootstrapServers("myServer1:9092,myServer2:9092")
+            .withTopics(topics)
+            .withConsumerFactoryFn(positionErrorConsumerFactory)
+            .withKeyDeserializer(IntegerDeserializer.class)
+            .withValueDeserializer(LongDeserializer.class)
+            .makeSource();
+
+    UnboundedReader<KafkaRecord<Integer, Long>> reader = 
source.createReader(null, null);
+
+    reader.start();
+
+    unboundedReaderExpectedLogs.verifyWarn("exception while fetching latest 
offset for partition");
+
+    reader.close();

Review Comment:
   should we verify that the exception is thrown? (if it's not thrown then the 
failed commit would not be retried, right?)





Issue Time Tracking
-------------------

    Worklog Id:     (was: 767429)
    Time Spent: 1.5h  (was: 1h 20m)

> Add Kafka IO exception test cases
> ---------------------------------
>
>                 Key: BEAM-14413
>                 URL: https://issues.apache.org/jira/browse/BEAM-14413
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-kafka
>            Reporter: John Casey
>            Assignee: John Casey
>            Priority: P2
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to