CalvinConfluent commented on code in PR #17698: URL: https://github.com/apache/kafka/pull/17698#discussion_r1847487700
########## core/src/test/scala/integration/kafka/api/TransactionsTest.scala: ########## @@ -794,6 +814,8 @@ class TransactionsTest extends IntegrationTestHarness { val producerId = producerStateEntry.producerId var previousProducerEpoch = producerStateEntry.producerEpoch + Thread.sleep(3000) // Wait for the markers to be persisted and the transaction state to be updated. Review Comment: The transaction coordinator is not accessible here. ########## clients/src/test/java/org/apache/kafka/clients/producer/internals/TransactionManagerTest.java: ########## @@ -922,6 +946,103 @@ public void testTransactionManagerEnablesV2() { assertTrue(transactionManager.isTransactionV2Enabled()); } + @Test + public void testTransactionV2AddPartitionAndOffsets() throws InterruptedException { + initializeTransactionManager(Optional.of(transactionalId), true); + doInitTransactions(); + + transactionManager.beginTransaction(); + + Future<RecordMetadata> responseFuture = appendToAccumulator(tp0); + + assertFalse(responseFuture.isDone()); + + prepareProduceResponse(Errors.NONE, producerId, epoch); + assertTrue(transactionManager.transactionContainsPartition(tp0)); Review Comment: Updated this part. And yes, the partition is added before the response. -- 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