how to unsubscribe? from these emails .. On Thu, Aug 17, 2023 at 11:24 PM <mj...@apache.org> wrote:
> This is an automated email from the ASF dual-hosted git repository. > > mjsax pushed a commit to branch trunk > in repository https://gitbox.apache.org/repos/asf/kafka.git > > > The following commit(s) were added to refs/heads/trunk by this push: > new d85a7008133 MINOR: Do not reuse admin client across tests (#14225) > d85a7008133 is described below > > commit d85a70081333a2ab9dd6593e99abf213a469ba2d > Author: Lucas Brutschy <lucas...@users.noreply.github.com> > AuthorDate: Thu Aug 17 19:53:58 2023 +0200 > > MINOR: Do not reuse admin client across tests (#14225) > > Reusing an admin client across tests can cause false positives in leak > checkers, so don't do it. > > Reviewers: Divij Vaidya <di...@amazon.com>, Matthias J. Sax < > matth...@confluent.io> > --- > .../integration/AbstractResetIntegrationTest.java | 19 > ++++++------------- > 1 file changed, 6 insertions(+), 13 deletions(-) > > diff --git > a/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java > b/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java > index 4bd3515782a..05b119da064 100644 > --- > a/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java > +++ > b/streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java > @@ -16,6 +16,7 @@ > */ > package org.apache.kafka.streams.integration; > > +import org.apache.kafka.common.utils.Utils; > import org.apache.kafka.tools.StreamsResetter; > import org.apache.kafka.clients.CommonClientConfigs; > import org.apache.kafka.clients.admin.Admin; > @@ -42,7 +43,6 @@ import org.apache.kafka.streams.kstream.Produced; > import org.apache.kafka.streams.kstream.TimeWindows; > import org.apache.kafka.test.IntegrationTest; > import org.apache.kafka.test.TestUtils; > -import org.junit.AfterClass; > import org.junit.Assert; > import org.junit.Rule; > import org.junit.Test; > @@ -54,7 +54,6 @@ import org.junit.rules.Timeout; > import java.io.BufferedWriter; > import java.io.File; > import java.io.FileWriter; > -import java.time.Duration; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collections; > @@ -84,14 +83,6 @@ public abstract class AbstractResetIntegrationTest { > @Rule > public final TestName testName = new TestName(); > > - @AfterClass > - public static void afterClassCleanup() { > - if (adminClient != null) { > - adminClient.close(Duration.ofSeconds(10)); > - adminClient = null; > - } > - } > - > protected Properties commonClientConfig; > protected Properties streamsConfig; > private Properties producerConfig; > @@ -186,10 +177,12 @@ public abstract class AbstractResetIntegrationTest { > } > > void cleanupTest() throws Exception { > - if (streams != null) { > - streams.close(Duration.ofSeconds(30)); > - } > + Utils.closeQuietly(streams, "kafka streams"); > IntegrationTestUtils.purgeLocalStreamsState(streamsConfig); > + if (adminClient != null) { > + Utils.closeQuietly(adminClient, "admin client"); > + adminClient = null; > + } > } > > private void add10InputElements() { > >