activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: SessionCloseOnGCTest#testCloseOneSessionOnGC avoiding intermittent failure
Date Mon, 26 Oct 2015 15:12:16 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 15b8b8138 -> bd946d2ce


SessionCloseOnGCTest#testCloseOneSessionOnGC avoiding intermittent failure


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/bd946d2c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/bd946d2c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/bd946d2c

Branch: refs/heads/master
Commit: bd946d2ce8defe7bf79d66c0690940f7b423917b
Parents: 15b8b81
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Mon Oct 26 11:10:48 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Oct 26 11:10:48 2015 -0400

----------------------------------------------------------------------
 .../tests/integration/client/SessionCloseOnGCTest.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bd946d2c/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
index 080322b..13b73df 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.artemis.tests.integration.client;
 
+import java.lang.ref.WeakReference;
+
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
@@ -26,8 +28,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.lang.ref.WeakReference;
-
 public class SessionCloseOnGCTest extends ActiveMQTestBase {
 
    private ActiveMQServer server;
@@ -191,6 +191,12 @@ public class SessionCloseOnGCTest extends ActiveMQTestBase {
 
       ActiveMQTestBase.checkWeakReferences(wses);
 
+      for (int i = 0; i < 100 && sf.numSessions() != 0; i++) {
+         System.gc();
+         System.runFinalization();
+         Thread.sleep(100);
+      }
+
       Assert.assertEquals(0, sf.numSessions());
       Assert.assertEquals(1, sf.numConnections());
       Assert.assertEquals(1, server.getRemotingService().getConnections().size());


Mime
View raw message