chia7712 commented on a change in pull request #9520: URL: https://github.com/apache/kafka/pull/9520#discussion_r553390132
########## File path: core/src/test/scala/integration/kafka/api/TransactionsTest.scala ########## @@ -407,46 +406,40 @@ class TransactionsTest extends KafkaServerTestHarness { TestUtils.waitUntilTrue(() => offsetAndMetadata.equals(consumer.committed(Set(tp).asJava).get(tp)), "cannot read committed offset") } - @Test(expected = classOf[TimeoutException]) + @Test def testInitTransactionsTimeout(): Unit = { testTimeout(false, producer => producer.initTransactions()) } - @Test(expected = classOf[TimeoutException]) + @Test def testSendOffsetsToTransactionTimeout(): Unit = { testTimeout(true, producer => producer.sendOffsetsToTransaction( Map(new TopicPartition(topic1, 0) -> new OffsetAndMetadata(0)).asJava, "test-group")) } - @Test(expected = classOf[TimeoutException]) + @Test def testCommitTransactionTimeout(): Unit = { testTimeout(true, producer => producer.commitTransaction()) } - @Test(expected = classOf[TimeoutException]) + @Test def testAbortTransactionTimeout(): Unit = { testTimeout(true, producer => producer.abortTransaction()) } - def testTimeout(needInitAndSendMsg: Boolean, + private def testTimeout(needInitAndSendMsg: Boolean, timeoutProcess: KafkaProducer[Array[Byte], Array[Byte]] => Unit): Unit = { - val producer = createTransactionalProducer("transactionProducer", maxBlockMs = 1000) - + val producer = createTransactionalProducer("transactionProducer", maxBlockMs = 3000) Review comment: ```1000``` is too small to complete ```createTransactionalProducer``` and it causes ```TimeoutException```. I don't think those test cases tried to test timeout on ```createTransactionalProducer```. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org