KAFKA-10264; Fix Flaky Test TransactionsTest.testBumpTransactionalEpoch (#9291)

The test case sends two records before killing broker. The failure is caused when both records are NOT sent in a single batch. The failure of first record can abort second batch and then produces `KafkaException` rather than `TimeoutException`. The patch removes the second record send.

Reviewers: Jason Gustafson <jason@confluent.io>
This commit is contained in:
Chia-Ping Tsai 2020-12-09 01:13:32 +08:00 committed by GitHub
parent 1d84f54367
commit aebb0e3394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 1 deletions

View File

@ -652,7 +652,6 @@ class TransactionsTest extends KafkaServerTestHarness {
producer.beginTransaction()
producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(topic1, null, "2", "2", willBeCommitted = false))
producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(testTopic, 0, "4", "4", willBeCommitted = false))
killBroker(partitionLeader) // kill the partition leader to prevent the batch from being submitted
val failedFuture = producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(testTopic, 0, "3", "3", willBeCommitted = false))