showuon commented on a change in pull request #9029:
URL: https://github.com/apache/kafka/pull/9029#discussion_r456227484



##########
File path: 
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorsIntegrationTest.java
##########
@@ -315,9 +319,34 @@ public void testReplication() throws InterruptedException {
             backup.kafka().consume(NUM_RECORDS_PRODUCED, 2 * 
RECORD_TRANSFER_DURATION_MS, "primary.test-topic-2").count());
     }
 
+    private void waitForConsumerGroupOffsetSync(Consumer<byte[], byte[]> 
consumer, List<String> topics)
+            throws InterruptedException {
+        Admin backupClient = backup.kafka().createAdminClient();
+        List<TopicPartition> tps = new ArrayList<>(NUM_PARTITIONS * 
topics.size());
+        IntStream.range(0, NUM_PARTITIONS).forEach(
+            partitionInd -> {

Review comment:
       I'll rename to `partitionIndex`. Thanks.

##########
File path: 
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorsIntegrationTest.java
##########
@@ -315,9 +319,34 @@ public void testReplication() throws InterruptedException {
             backup.kafka().consume(NUM_RECORDS_PRODUCED, 2 * 
RECORD_TRANSFER_DURATION_MS, "primary.test-topic-2").count());
     }
 
+    private void waitForConsumerGroupOffsetSync(Consumer<byte[], byte[]> 
consumer, List<String> topics)
+            throws InterruptedException {
+        Admin backupClient = backup.kafka().createAdminClient();
+        List<TopicPartition> tps = new ArrayList<>(NUM_PARTITIONS * 
topics.size());
+        IntStream.range(0, NUM_PARTITIONS).forEach(
+            partitionInd -> {
+                for (String topic: topics) {
+                    tps.add(new TopicPartition(topic, partitionInd));
+                }
+            }
+        );
+        long expectedTotalOffsets = NUM_RECORDS_PRODUCED * topics.size();
+
+        waitForCondition(() -> {
+            Map<TopicPartition, OffsetAndMetadata> consumerGroupOffsets =
+                
backupClient.listConsumerGroupOffsets("consumer-group-1").partitionsToOffsetAndMetadata().get();

Review comment:
       Good suggestion. Thanks.




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


Reply via email to