diff --git a/extensions-core/kafka-extraction-namespace/src/test/java/org/apache/druid/query/lookup/TestKafkaExtractionCluster.java b/extensions-core/kafka-extraction-namespace/src/test/java/org/apache/druid/query/lookup/TestKafkaExtractionCluster.java index 773821eb98b..318b7135346 100644 --- a/extensions-core/kafka-extraction-namespace/src/test/java/org/apache/druid/query/lookup/TestKafkaExtractionCluster.java +++ b/extensions-core/kafka-extraction-namespace/src/test/java/org/apache/druid/query/lookup/TestKafkaExtractionCluster.java @@ -91,6 +91,9 @@ public class TestKafkaExtractionCluster { zkServer = new TestingCluster(1); zkServer.start(); + closer.register(() -> { + zkServer.stop(); + }); kafkaServer = new KafkaServer( getBrokerProperties(), @@ -99,6 +102,10 @@ public class TestKafkaExtractionCluster false); kafkaServer.startup(); + closer.register(() -> { + kafkaServer.shutdown(); + kafkaServer.awaitShutdown(); + }); log.info("---------------------------Started Kafka Broker ---------------------------"); log.info("---------------------------Publish Messages to topic-----------------------");