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


##########
tests/kafkatest/tests/verifiable_consumer_test.py:
##########
@@ -86,3 +86,12 @@ def await_members(self, consumer, num_consumers):
         
     def await_all_members(self, consumer):
         self.await_members(consumer, self.num_consumers)
+
+    def await_all_members_stabilized(self, topic, num_partitions, consumer, 
timeout_sec):
+        # Wait until the group is in STABLE state and the consumers reconcile 
to a valid assignment
+        wait_until(lambda: self.group_id in 
self.kafka.list_consumer_groups(state="stable"),
+                   timeout_sec=timeout_sec,
+                   err_msg="Timed out waiting for group %s to transition to 
STABLE state." % self.group_id)
+        wait_until(lambda: self.valid_assignment(topic, num_partitions, 
consumer.current_assignment()),
+                   timeout_sec=timeout_sec,
+                   err_msg="Timeout awaiting for the consumers to reconcile to 
a valid assignment.")

Review Comment:
   For my understanding, we need the second check because the group could be 
reported as stable by the server but the members may not be reconciled yet. Is 
my understanding correct?



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