dajac commented on code in PR #12501:
URL: https://github.com/apache/kafka/pull/12501#discussion_r947568529


##########
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:
   Yeah, this is exactly why I don't like those sleeps in test. In the end, you 
don't know if you are lucky or if the conditions you wanted really were met.



-- 
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

Reply via email to