From 196e604778745349fca2deae44bab397cc9fa5b4 Mon Sep 17 00:00:00 2001 From: Robbie Gemmell Date: Fri, 17 Jun 2022 13:02:37 +0100 Subject: [PATCH] NO-JIRA: suppress significant teardown stacktraces after compatibility test that is a no-op...make test itself skip --- .../tests/compatibility/ExportImportTest.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/ExportImportTest.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/ExportImportTest.java index 903165ff2c..f7852b40ce 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/ExportImportTest.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/ExportImportTest.java @@ -24,6 +24,7 @@ import java.util.List; import org.apache.activemq.artemis.tests.compatibility.base.VersionedBase; import org.apache.activemq.artemis.utils.FileUtil; import org.junit.After; +import org.junit.Assume; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -48,6 +49,7 @@ import static org.apache.activemq.artemis.tests.compatibility.GroovyRun.SNAPSHOT @RunWith(Parameterized.class) public class ExportImportTest extends VersionedBase { private String serverScriptToUse; + private boolean skipTearDownCleanup = false; // this will ensure that all tests in this class are run twice, // once with "true" passed to the class' constructor and once with "false" @@ -81,6 +83,11 @@ public class ExportImportTest extends VersionedBase { @After public void tearDown() { + if (skipTearDownCleanup) { + // Skip server teardown when test is no-op, avoids a chunk of stacktrace + return; + } + try { stopServer(serverClassloader); } catch (Throwable ignored) { @@ -100,10 +107,12 @@ public class ExportImportTest extends VersionedBase { @Test public void testSendReceivelegacy() throws Throwable { - if (!sender.equals(SNAPSHOT)) { - // makes no sense on snapshot - internalSendReceive(true); - } + // makes no sense on snapshot + boolean isSenderSnapshot = SNAPSHOT.equals(sender); + skipTearDownCleanup = isSenderSnapshot; + Assume.assumeFalse("This test only applies to old version senders", isSenderSnapshot); + + internalSendReceive(true); } public void internalSendReceive(boolean legacyPrefixes) throws Throwable {