fapaul commented on a change in pull request #18009: URL: https://github.com/apache/flink/pull/18009#discussion_r764791259
########## File path: flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/FlinkKafkaInternalProducerITCase.java ########## @@ -88,20 +92,45 @@ void testInitTransactionId() { reuse.abortTransaction(); } assertNumTransactions(i); - assertThat(readRecords(TEST_TOPIC).count(), equalTo(i / 2)); + assertThat(readRecords(TEST_TOPIC).count()).isEqualTo(i / 2); } } } + @ParameterizedTest + @MethodSource("provideTransactionsFinalizer") + void testResetInnerTransactionIfFinalizingTransactionFailed( + Consumer<FlinkKafkaInternalProducer<?, ?>> transactionFinalizer) { + try (FlinkKafkaInternalProducer<String, String> reuse = + new FlinkKafkaInternalProducer<>(getProperties(), "dummy")) { + reuse.initTransactions(); + reuse.beginTransaction(); + reuse.send(new ProducerRecord<>(TEST_TOPIC, "test-value")); + reuse.close(); Review comment: I updated the test case to start a second producer which fences the first one to fail during committing. PTAL -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org