TaiJuWu commented on code in PR #16627:
URL: https://github.com/apache/kafka/pull/16627#discussion_r1689010781
##########
core/src/test/java/kafka/test/ClusterInstance.java:
##########
@@ -183,6 +193,67 @@ default Set<GroupProtocol> supportedGroupProtocols() {
//---------------------------[wait]---------------------------//
+ @SuppressWarnings("deprecation")
+ default void verifyTopicDeletion(String topic, int partitions) throws
InterruptedException {
+ if (!isKRaftTest()) {
+ TestUtils.waitForCondition(
+ () -> !((IntegrationTestHarness)
getUnderlying()).zkClient().isTopicMarkedForDeletion(topic),
+ String.format("Admin path /admin/delete_topics/%s path not
deleted even after a replica is restarted", topic)
+ );
+
+ TestUtils.waitForCondition(
+ () -> !((IntegrationTestHarness)
getUnderlying()).zkClient().topicExists(topic),
+ String.format("Topic path /brokers/topics/%s not deleted
after /admin/delete_topics/%s path is deleted", topic, topic)
+ );
+ }
+
+ List<TopicPartition> topicPartitions = IntStream.range(0,
partitions).mapToObj(i -> new TopicPartition(topic,
i)).collect(Collectors.toList());
+ TestUtils.waitForCondition(
+ () ->
+ brokers().values().stream().allMatch(broker ->
+ topicPartitions.stream().allMatch(tp ->
+
broker.replicaManager().onlinePartition(tp).isEmpty())
+ ), "Replica manager's should have deleted all of this
topic's partitions"
+ );
+
+ TestUtils.waitForCondition(
+ () ->
+ brokers().values().stream().allMatch(broker ->
+ topicPartitions.stream().allMatch(tp ->
+
broker.replicaManager().onlinePartition(tp).isEmpty())
Review Comment:
It already check
[here](https://github.com/apache/kafka/blob/63fccc4f4cd37a6d205630b3b0b31ff70cf73317/core/src/test/java/kafka/test/ClusterInstance.java#L214-L220)
Or I miss something?
--
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]