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

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

                Author: ASF GitHub Bot
            Created on: 09/May/22 15:41
            Start Date: 09/May/22 15:41
    Worklog Time Spent: 10m 
      Work Description: johnjcasey commented on code in PR #17565:
URL: https://github.com/apache/beam/pull/17565#discussion_r868156320


##########
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:
   Similar to above comment, the offsets here are committed periodically, 
although this period is configured to be 1 second instead of 5 mintues. This 
test is to verify that the exception block is executed as expected





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

    Worklog Id:     (was: 767973)
    Time Spent: 1h 50m  (was: 1h 40m)

> 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: 1h 50m
>  Remaining Estimate: 0h
>




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

Reply via email to