Nikita-Shupletsov commented on code in PR #22968:
URL: https://github.com/apache/kafka/pull/22968#discussion_r3660804652
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/admin/AdminMetadataTest.java:
##########
@@ -108,16 +108,18 @@ public void testListNodesWithFencedBroker() throws
Exception {
public void testDescribeCluster() throws Exception {
try (Admin admin = clusterInstance.admin()) {
DescribeClusterResult result = admin.describeCluster();
- Collection<Node> nodes = result.nodes().get();
assertEquals(clusterInstance.clusterId(),
result.clusterId().get());
// In KRaft, we return a random brokerId as the current controller.
Node controller = result.controller().get();
assertTrue(clusterInstance.brokerIds().contains(controller.id()));
Set<String> brokerEndpoints =
Set.of(clusterInstance.bootstrapServers().split(","));
- assertEquals(brokerEndpoints.size(), nodes.size());
- for (Node node : nodes) {
+ TestUtils.waitForCondition(
Review Comment:
yep, it's a much better approach. 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]