dajac commented on code in PR #12501:
URL: https://github.com/apache/kafka/pull/12501#discussion_r946893165
##########
core/src/test/scala/integration/kafka/api/TransactionsExpirationTest.scala:
##########
@@ -105,6 +105,36 @@ class TransactionsExpirationTest extends
KafkaServerTestHarness {
}
}
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
+ @ValueSource(strings = Array("zk", "kraft"))
+ def testTransactionAfterProducerIDExpires(quorum: String): Unit = {
+ producer.initTransactions()
+
+ // Start and then abort a transaction to allow the producer ID to expire
+ producer.beginTransaction()
+
producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(topic1, 0,
"2", "2", willBeCommitted = false))
+
producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(topic2, 0,
"4", "4", willBeCommitted = false))
+ producer.abortTransaction()
+
+ // Wait for the producer ID to expire
+ Thread.sleep(1000)
Review Comment:
Yes, we do. Could we use waitUntilTrue and look into the producer state
manager instead of using sleep? That would be a stronger assertion if that is
possible.
--
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]