lianetm commented on code in PR #22968:
URL: https://github.com/apache/kafka/pull/22968#discussion_r3660310333
##########
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:
since we have the `clusterInstance` here, could we reuse the
`waitForReadyBrokers`? (and maybe before doing the first describe, so we only
do 1 describe but only after everything is ready)
I see that other admin tests do the `waitForReadyBrokers` on the setup phase
btw, e.g.,
https://github.com/apache/kafka/blob/63f445aaa9688f919d0606f2c6d118b6a7e3f3b3/clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/admin/AdminClientWithPoliciesIntegrationTest.java#L72
--
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]