From a7aafc0ab4c027e0739b6320422f4e2cc041b264 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 7 Jul 2020 15:26:35 -0400 Subject: [PATCH] NO-JIRA small tweak on ActiveMQTestBase --- .../artemis/tests/util/ActiveMQTestBase.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index 8209f0ab88..981e38e046 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -149,6 +149,7 @@ import org.apache.activemq.artemis.utils.Wait; import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory; import org.jboss.logging.Logger; import org.junit.After; +import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.ClassRule; @@ -2031,6 +2032,13 @@ public abstract class ActiveMQTestBase extends Assert { } } + @AfterClass + public static void checkLibaio() throws Throwable { + if (!Wait.waitFor(() -> LibaioContext.getTotalMaxIO() == 0)) { + Assert.fail("test did not close all its files " + LibaioContext.getTotalMaxIO()); + } + } + private void checkFilesUsage() throws Exception { int invmSize = InVMRegistry.instance.size(); if (invmSize > 0) { @@ -2038,11 +2046,6 @@ public abstract class ActiveMQTestBase extends Assert { baseLog.info(threadDump("Thread dump")); fail("invm registry still had acceptors registered"); } - - if (!Wait.waitFor(() -> LibaioContext.getTotalMaxIO() == 0)) { - Assert.fail("test did not close all its files " + LibaioContext.getTotalMaxIO()); - } - } private void cleanupPools() {