From 668fe79bfbcddb939167baec8b0fefda6dfa188e Mon Sep 17 00:00:00 2001 From: see-quick Date: Mon, 4 Nov 2024 11:16:57 +0100 Subject: [PATCH 1/3] Fix memory problems inside test suite Signed-off-by: see-quick --- .../java/io/strimzi/test/container/StrimziKafkaContainerIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java b/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java index 061167c1..c312ace8 100644 --- a/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java +++ b/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java @@ -312,6 +312,7 @@ void testGetProxyWithNoContainer(final String imageName) { .waitForRunning(); systemUnderTest.start(); assertThrows(IllegalStateException.class, () -> systemUnderTest.getProxy()); + systemUnderTest.stop(); } @Test From e3d0d6b156b1c997e21b55b87ed796602500d910 Mon Sep 17 00:00:00 2001 From: see-quick Date: Mon, 4 Nov 2024 12:38:29 +0100 Subject: [PATCH 2/3] add after each Signed-off-by: see-quick --- .../test/container/StrimziKafkaKraftContainerIT.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/io/strimzi/test/container/StrimziKafkaKraftContainerIT.java b/src/test/java/io/strimzi/test/container/StrimziKafkaKraftContainerIT.java index b278d915..8ffaa840 100644 --- a/src/test/java/io/strimzi/test/container/StrimziKafkaKraftContainerIT.java +++ b/src/test/java/io/strimzi/test/container/StrimziKafkaKraftContainerIT.java @@ -14,6 +14,7 @@ import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringSerializer; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -172,4 +173,11 @@ private void verify() throws InterruptedException, ExecutionException, TimeoutEx assertThat(records.records(topic).get(2).value(), equalTo("3")); } } + + @AfterEach + void afterEach() { + if (this.systemUnderTest != null) { + this.systemUnderTest.stop(); + } + } } From d4b2492c879b84b5f8f51c482bd4a66728933b19 Mon Sep 17 00:00:00 2001 From: see-quick Date: Mon, 4 Nov 2024 12:39:22 +0100 Subject: [PATCH 3/3] also for KafkaContainerIT Signed-off-by: see-quick --- .../strimzi/test/container/StrimziKafkaContainerIT.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java b/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java index c312ace8..51c84829 100644 --- a/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java +++ b/src/test/java/io/strimzi/test/container/StrimziKafkaContainerIT.java @@ -17,6 +17,7 @@ import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringSerializer; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.Logger; @@ -378,4 +379,11 @@ void testKafkaContainerFunctionality() { } } } + + @AfterEach + void afterEach() { + if (this.systemUnderTest != null) { + this.systemUnderTest.stop(); + } + } }