activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [activemq-artemis] branch master updated: NO-JIRA Fixing intermittent failures
Date Tue, 10 Sep 2019 18:58:19 GMT
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 7fd7558  NO-JIRA Fixing intermittent failures
7fd7558 is described below

commit 7fd7558ed81c569e2cb1e317b48578ce862bbf93
Author: Clebert Suconic <clebertsuconic@apache.org>
AuthorDate: Tue Sep 10 14:53:49 2019 -0400

    NO-JIRA Fixing intermittent failures
---
 .../artemis/tests/util/ActiveMQTestBase.java        | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 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 458da17..434f366 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
@@ -143,6 +143,7 @@ import org.apache.activemq.artemis.utils.RandomUtil;
 import org.apache.activemq.artemis.utils.ThreadDumpUtil;
 import org.apache.activemq.artemis.utils.ThreadLeakCheckRule;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.apache.activemq.artemis.utils.Wait;
 import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory;
 import org.jboss.logging.Logger;
 import org.junit.After;
@@ -2025,17 +2026,7 @@ public abstract class ActiveMQTestBase extends Assert {
       }
    }
 
-   private void checkFilesUsage() {
-
-      long timeout = System.currentTimeMillis() + 15000;
-
-      while (LibaioContext.getTotalMaxIO() != 0 && System.currentTimeMillis() >
timeout) {
-         try {
-            Thread.sleep(100);
-         } catch (Exception ignored) {
-         }
-      }
-
+   private void checkFilesUsage() throws Exception {
       int invmSize = InVMRegistry.instance.size();
       if (invmSize > 0) {
          InVMRegistry.instance.clear();
@@ -2043,11 +2034,11 @@ public abstract class ActiveMQTestBase extends Assert {
          fail("invm registry still had acceptors registered");
       }
 
-      final long totalMaxIO = LibaioContext.getTotalMaxIO();
-      if (totalMaxIO != 0) {
-         LibaioContext.resetMaxAIO();
-         Assert.fail("test did not close all its files " + totalMaxIO);
+      if (!Wait.waitFor(() -> LibaioContext.getTotalMaxIO() == 0)) {
+         Assert.fail("There are still libaio files open :: " + LibaioContext.getTotalMaxIO());
+         Assert.fail("test did not close all its files " + LibaioContext.getTotalMaxIO());
       }
+
    }
 
    private void cleanupPools() {


Mime
View raw message