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


##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java:
##########
@@ -5692,12 +5725,60 @@ private void assertApiMessageAndVersionEquals(
                 
fromTopicPartitions(actualValue.partitionsPendingRevocation()));
             
assertEquals(fromTopicPartitions(expectedValue.partitionsPendingAssignment()),
                 
fromTopicPartitions(actualValue.partitionsPendingAssignment()));
-        } else {
-            assertEquals(expected.message(), actual.message());
+        } else if (actual.message() instanceof 
ConsumerGroupPartitionMetadataValue) {
+            // The order of the racks stored in PartitionMetadata of 
ConsumerGroupPartitionMetadataValue is not
+            // always guaranteed. Therefore, we need a special comparator.
+            ConsumerGroupPartitionMetadataValue expectedValue =
+                (ConsumerGroupPartitionMetadataValue) expected.message();
+            ConsumerGroupPartitionMetadataValue actualValue =
+                (ConsumerGroupPartitionMetadataValue) actual.message();
+

Review Comment:
   Should we assert numPartitions as well?



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