lucasbru commented on code in PR #20509:
URL: https://github.com/apache/kafka/pull/20509#discussion_r2348165503


##########
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);
+    public static EmbeddedKafkaCluster cluster = null;
     public TestInfo testInfo;
+    public ArrayList<SmokeTestClient> clients = new ArrayList<>();
 
     @BeforeAll
     public static void startCluster() throws IOException {
-        CLUSTER.start();
+        cluster = new EmbeddedKafkaCluster(3);

Review Comment:
   hey @chia7712 - Maybe I didn't explain this well enough. 
   
   If you want to run the integration test several times (e.g. using Intellij), 
you need to recreate the `EmbeddedKafkaCluster`. Because after the first run of 
the integration test, we call `CLUSTER.stop()`, and a cluster that was stopped 
cannot be restarted again. So we need to create a new instance of 
`EmbeddedKafkaCluster` for every full run of the tests in this class.
   
   Furthermore, I absolutely don't like that we store heavy objects like 
`EmbeddedKafkaCluster` in static variables - even if they are stopped, they 
will stay in memory for a long time while other tests execute. 



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

Reply via email to