chia7712 commented on code in PR #23343:
URL: https://github.com/apache/kafka/pull/23343#discussion_r3997296074
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/ClientRebootstrapTest.java:
##########
@@ -97,15 +94,17 @@ public void testAdminRebootstrapDisabled(ClusterInstance
clusterInstance) {
try {
admin.createTopics(List.of(new NewTopic(TOPIC, PARTITIONS, (short)
REPLICAS)));
// Only the broker 1 is available for the admin client during the
bootstrap.
- var topics = assertDoesNotThrow(() ->
admin.listTopics().names().get(60, TimeUnit.SECONDS));
- assertTrue(topics.contains(TOPIC));
+ TestUtils.waitForCondition(() -> admin.listTopics().names().get(5,
TimeUnit.SECONDS).contains(TOPIC), 60 * 1000, "Topic not visible after
creation");
clusterInstance.shutdownBroker(broker1);
clusterInstance.startBroker(broker0);
// The broker 1, originally cached during the bootstrap, is
offline.
- // As a result, the admin client will throw a TimeoutException
when trying to get list of the topics.
- assertThrows(TimeoutException.class, () ->
admin.listTopics().names().get(5, TimeUnit.SECONDS));
+ // As a result, the admin client will fail when trying to get the
list of topics.
Review Comment:
Pardon me, I'm not sure I follow your point. As I mentioned above, the
metadata should have been synced. Why do we need to wait here? Also, why do we
use `Exception` instead of TimeoutException
--
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]