diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/InvalidBrokerConfigForAuthorizationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/InvalidBrokerConfigForAuthorizationTest.java index f6e6619f7c4971..065a0a8e1bd17d 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/InvalidBrokerConfigForAuthorizationTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/InvalidBrokerConfigForAuthorizationTest.java @@ -21,6 +21,7 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; import org.apache.pulsar.broker.PulsarServerException; +import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; public class InvalidBrokerConfigForAuthorizationTest extends MockedPulsarServiceBaseTest { @@ -47,6 +48,8 @@ protected void setup() throws Exception { } + + @AfterMethod(alwaysRun = true) @Override protected void cleanup() throws Exception { internalCleanup(); diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/ExceptionsBrokerInterceptorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/ExceptionsBrokerInterceptorTest.java index 0aa80cdad1ec70..007378493cb0a0 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/ExceptionsBrokerInterceptorTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/ExceptionsBrokerInterceptorTest.java @@ -22,7 +22,6 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; - import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; @@ -35,6 +34,7 @@ import org.apache.pulsar.client.impl.ConsumerImpl; import org.apache.pulsar.common.nar.NarClassLoader; import org.awaitility.Awaitility; +import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -53,6 +53,7 @@ public void setup() throws Exception { super.producerBaseSetup(); } + @AfterMethod(alwaysRun = true) @Override protected void cleanup() throws Exception { super.internalCleanup();