lucasbru commented on code in PR #20509: URL: https://github.com/apache/kafka/pull/20509#discussion_r2343423016
########## streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/SmokeTestDriverIntegrationTest.java: ########## @@ -46,29 +47,43 @@ import static org.apache.kafka.streams.tests.SmokeTestDriver.generate; import static org.apache.kafka.streams.tests.SmokeTestDriver.verify; import static org.apache.kafka.streams.utils.TestUtils.safeUniqueTestName; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @Timeout(600) @Tag("integration") public class SmokeTestDriverIntegrationTest { - public static final EmbeddedKafkaCluster CLUSTER = new EmbeddedKafkaCluster(3); + private static EmbeddedKafkaCluster cluster = null; public TestInfo testInfo; + private ArrayList<SmokeTestClient> clients = new ArrayList<>(); @BeforeAll public static void startCluster() throws IOException { - CLUSTER.start(); + cluster = new EmbeddedKafkaCluster(3); + cluster.start(); } @AfterAll public static void closeCluster() { - CLUSTER.stop(); + cluster.stop(); + cluster = null; } @BeforeEach public void setUp(final TestInfo testInfo) { this.testInfo = testInfo; } + @AfterEach + public void shutDown(final TestInfo testInfo) { + // Clean up clients in case the test failed or timed out + for (final SmokeTestClient client : clients) { + if (!client.closed() && !client.error()) { Review Comment: It will log something like "Skipping shutdown since Streams client is already in the terminal state..." for all clients, which would be rather annoying. -- 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