You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/05/19 19:25:22 UTC

[GitHub] [kafka] mumrah commented on a change in pull request #10338: KAFKA-10251: wait for consumer rebalance completed before consuming records

mumrah commented on a change in pull request #10338:
URL: https://github.com/apache/kafka/pull/10338#discussion_r635464179



##########
File path: core/src/test/scala/integration/kafka/api/TransactionsBounceTest.scala
##########
@@ -83,16 +84,33 @@ class TransactionsBounceTest extends IntegrationTestHarness {
       producer.sendOffsetsToTransaction(TestUtils.consumerPositions(consumer).asJava, consumer.groupMetadata()))
   }
 
+  private def waitForRebalancingCompleted(consumer: Consumer[Array[Byte], Array[Byte]],
+                                          expectedAssignment: Set[TopicPartition]): Unit = {
+    TestUtils.pollUntilTrue(consumer, () => consumer.assignment() == expectedAssignment.asJava,
+      s"Timed out while waiting expected assignment $expectedAssignment. " +
+        s"The current assignment is ${consumer.assignment()}", waitTimeMs = rebalanceTimeout)

Review comment:
       nit: alignment seems off




-- 
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:
users@infra.apache.org