This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch 2.4
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.4 by this push:
     new 7f740a2  KAFKA-8995: delete all topics before recreating (#8208)
7f740a2 is described below

commit 7f740a2ade362c236ab9359ac28241c7c4b4cd38
Author: Guozhang Wang <[email protected]>
AuthorDate: Mon Mar 2 17:24:19 2020 -0800

    KAFKA-8995: delete all topics before recreating (#8208)
    
    I think the root cause of KAFKA-8893, KAFKA-8894, KAFKA-8895 and 
KSTREAMS-3779 are the same: some intermediate topics are not deleted in the 
setup logic before recreating the user topics, which could cause the 
waitForDeletion (that check exact match of all existing topics) to fail, and 
also could cause more records to be returned because of the intermediate topics 
that are not deleted from the previous test case.
    
    Also inspired by https://github.com/apache/kafka/pull/5418/files I used a 
longer timeout (120 secs) for deleting all topics.
    
    Reviewers: John Roesler <[email protected]>
---
 .../apache/kafka/streams/integration/AbstractResetIntegrationTest.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java
 
b/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java
index 675286b..dcf0304 100644
--- 
a/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java
+++ 
b/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java
@@ -190,7 +190,8 @@ public abstract class AbstractResetIntegrationTest {
         TestUtils.waitForCondition(new ConsumerGroupInactiveCondition(), 
TIMEOUT_MULTIPLIER * CLEANUP_CONSUMER_TIMEOUT,
                 "Test consumer group " + appID + " still active even after 
waiting " + (TIMEOUT_MULTIPLIER * CLEANUP_CONSUMER_TIMEOUT) + " ms.");
 
-        cluster.deleteAndRecreateTopics(INPUT_TOPIC, OUTPUT_TOPIC, 
OUTPUT_TOPIC_2, OUTPUT_TOPIC_2_RERUN);
+        cluster.deleteAllTopicsAndWait(120000);
+        cluster.createTopics(INPUT_TOPIC, OUTPUT_TOPIC, OUTPUT_TOPIC_2, 
OUTPUT_TOPIC_2_RERUN);
 
         add10InputElements();
     }

Reply via email to