Yunyung commented on code in PR #20155: URL: https://github.com/apache/kafka/pull/20155#discussion_r2201444279
########## streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/HandlingSourceTopicDeletionIntegrationTest.java: ########## @@ -42,10 +42,13 @@ import java.util.Locale; import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import static org.apache.kafka.streams.utils.TestUtils.safeUniqueTestName; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; Review Comment: ditto ########## streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/HandlingSourceTopicDeletionIntegrationTest.java: ########## @@ -42,10 +42,13 @@ import java.util.Locale; import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.CountDownLatch; Review Comment: Why import this? ########## streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/HandlingSourceTopicDeletionIntegrationTest.java: ########## @@ -124,12 +127,15 @@ public void shouldThrowErrorAfterSourceTopicDeleted(final boolean useNewProtocol CLUSTER.deleteTopic(INPUT_TOPIC); - TestUtils.waitForCondition( - () -> kafkaStreams1.state() == State.ERROR && kafkaStreams2.state() == State.ERROR, - TIMEOUT, - () -> "Kafka Streams clients did not reach state ERROR" - ); + if (!useNewProtocol) { + TestUtils.waitForCondition( + () -> kafkaStreams1.state() == State.ERROR && kafkaStreams2.state() == State.ERROR, + TIMEOUT, + () -> "Kafka Streams clients did not reach state ERROR" + ); + } + TimeUnit.SECONDS.sleep(5); assertThat(calledUncaughtExceptionHandler1.get(), is(true)); assertThat(calledUncaughtExceptionHandler2.get(), is(true)); Review Comment: How about doing this instead of always sleeping for a fixed time ```suggestion TestUtils.waitForCondition( () -> calledUncaughtExceptionHandler1.get() && calledUncaughtExceptionHandler2.get(), TIMEOUT, () -> "......Error Message......" ); ``` -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org