From f2aeff0026c6406e9d0b01ad4aaa7486522784ee Mon Sep 17 00:00:00 2001 From: ashwinpankaj Date: Tue, 5 Dec 2023 22:46:06 +0530 Subject: [PATCH] KAFKA-9545: Fix Flaky Test `RegexSourceIntegrationTest.testRegexMatchesTopicsAWhenDeleted` (#14910) RegexSourceIntegrationTest.testRegexMatchesTopicsAWhenDeleted does not wait to ensure that test-topic-A is deleted. The second assignment condition times out in 15sec. We should wait for the topic to be deleted (default timeout = 30sec) and then check the assignment. Reviewers: Walker Carlson --- .../kafka/streams/integration/RegexSourceIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/RegexSourceIntegrationTest.java b/streams/src/test/java/org/apache/kafka/streams/integration/RegexSourceIntegrationTest.java index 4a64c84cf75..e5f3080f8bb 100644 --- a/streams/src/test/java/org/apache/kafka/streams/integration/RegexSourceIntegrationTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/integration/RegexSourceIntegrationTest.java @@ -289,7 +289,7 @@ public class RegexSourceIntegrationTest { streams.start(); TestUtils.waitForCondition(() -> assignedTopics.equals(expectedFirstAssignment), STREAM_TASKS_NOT_UPDATED); } finally { - CLUSTER.deleteTopic("TEST-TOPIC-A"); + CLUSTER.deleteTopicAndWait("TEST-TOPIC-A"); } TestUtils.waitForCondition(() -> assignedTopics.equals(expectedSecondAssignment), STREAM_TASKS_NOT_UPDATED);