chia7712 commented on code in PR #23827:
URL: https://github.com/apache/kafka/pull/23827#discussion_r4295748141


##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/admin/DeleteTopicTest.java:
##########
@@ -64,19 +72,62 @@ public class DeleteTopicTest {
     private static final String DEFAULT_TOPIC = "topic";
     private final Map<Integer, List<Integer>> expectedReplicaAssignment = 
Map.of(0, List.of(0, 1, 2));
 
-    @ClusterTest
+    @ClusterTest(serverProperties = {
+        @ClusterConfigProperty(key = LOG_INITIAL_TASK_DELAY_MS_CONFIG, value = 
"100"),
+        @ClusterConfigProperty(key = "log.segment.delete.delay.ms", value = 
"1000")
+    })
     public void testCreateAndDeleteTopic(ClusterInstance cluster) throws 
Exception {
         String testTopic = "test-topic";
         try (Admin admin = cluster.admin()) {
             // Create a test topic
             cluster.createTopic(testTopic, 1, (short) 3);
+            TopicPartition topicPartition = new TopicPartition(testTopic, 0);
+            waitForReplicaCreated(cluster.brokers(), topicPartition, "Replicas 
were not created");
 
             // Delete topic
             DeleteTopicsResult deleteResult = 
admin.deleteTopics(List.of(testTopic));
             deleteResult.all().get();
 
             // Wait for topic deletion
             cluster.waitTopicDeletion(testTopic);
+            // Ensure that the topic directories are hard-deleted
+            TestUtils.waitForCondition(() -> 
cluster.brokers().values().stream().allMatch(broker ->

Review Comment:
   ```java
      TestUtils.waitForCondition(() -> topicDirectories(cluster, 
testTopic).isEmpty(),
          "Failed to hard-delete the delete directory");
   ```



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

Reply via email to