[activemq-artemis] branch master updated: NO-JIRA Adding test name into temporary folder name directory

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[activemq-artemis] branch master updated: NO-JIRA Adding test name into temporary folder name directory

jbertram
This is an automated email from the ASF dual-hosted git repository.

jbertram 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 bbe9f9a  NO-JIRA Adding test name into temporary folder name directory
     new 269ad82  This closes #2936
bbe9f9a is described below

commit bbe9f9adceb9ab6561ce247f22b3c47d856f0ec0
Author: Clebert Suconic <[hidden email]>
AuthorDate: Fri Jan 10 17:35:28 2020 -0500

    NO-JIRA Adding test name into temporary folder name directory
   
    This is to make it possible to identify what test is leaking files whenever that is happening.
    That is because future tests will report the leaks, and it's difficult to identify where it happened.
   
    Also i'm changing NoProcessFilesBehind to show the getOpenFD propertly
---
 .../java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java | 4 +++-
 .../org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java  | 2 +-
 2 files changed, 4 insertions(+), 2 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 bd5836e..b5f6b30 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
@@ -264,7 +264,9 @@ public abstract class ActiveMQTestBase extends Assert {
    public ActiveMQTestBase() {
       File parent = new File(TARGET_TMP);
       parent.mkdirs();
-      temporaryFolder = new TemporaryFolder(parent);
+      File subParent = new File(parent, this.getClass().getSimpleName());
+      subParent.mkdirs();
+      temporaryFolder = new TemporaryFolder(subParent);
    }
 
    protected <T> T serialClone(Object object) throws Exception {
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java
index c9e6dad..527ffb2 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/NoProcessFilesBehind.java
@@ -139,7 +139,7 @@ public class NoProcessFilesBehind extends TestWatcher {
 
       if (!Wait.waitFor(() -> getOpenFD() < maxFiles, 5000, 0)) {
          String fileList = getOpenList();
-         Assert.fail("Too many files open (" + maxFiles + "). A possible list: " + fileList);
+         Assert.fail("Too many files open (" + getOpenFD()  + ">" + maxFiles + "). A possible list: " + fileList);
       }
 
    }