artemlivshits commented on code in PR #18264:
URL: https://github.com/apache/kafka/pull/18264#discussion_r1893044747
##########
core/src/test/scala/integration/kafka/api/TransactionsTest.scala:
##########
@@ -801,20 +800,19 @@ class TransactionsTest extends IntegrationTestHarness {
producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(testTopic,
0, "4", "4", willBeCommitted = true))
producer.commitTransaction()
- // Get producerId and epoch after first commit
+ // Second transaction: abort
+ producer.beginTransaction()
+ val successfulFuture =
producer.send(TestUtils.producerRecordWithExpectedTransactionStatus(topic1,
null, "2", "2", willBeCommitted = false))
+ TestUtils.waitUntilTrue(successfulFuture.isDone, "First message of the
second transaction did not complete its send.")
Review Comment:
Yeah, I think for the tests it's more important to recover if the tested
code gets stuck, than to be optimal from the perf perspective (obviously .get
is more efficient because it would just block the thread, vs. waitUntilTrue
would just loop and poll). If we want to fail on send failure (not sure if
this is the goal of the test) we can use .get after waitUntilTrue.
--
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]