[jboss-cvs] JBoss Messaging SVN: r6033 - trunk/tests/src/org/jboss/messaging/tests/integration/remoting.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 6 17:17:10 EST 2009


Author: clebert.suconic at jboss.com
Date: 2009-03-06 17:17:09 -0500 (Fri, 06 Mar 2009)
New Revision: 6033

Modified:
   trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java
Log:
The test failed because it didn't get the Exception. This may be caused by races on calling the Listeners. Trying to fix the test.

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java	2009-03-06 22:10:55 UTC (rev 6032)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java	2009-03-06 22:17:09 UTC (rev 6033)
@@ -334,15 +334,11 @@
 
       serverConn.addFailureListener(serverListener);
 
-      for (int i = 0; i < 20; i++)
+      for (int i = 0; i < 40; i++)
       {
          // a few tries to avoid a possible race caused by GCs or similar issues
-         if (messagingService.getServer().getRemotingService().getConnections().isEmpty())
+         if (messagingService.getServer().getRemotingService().getConnections().isEmpty() && clientListener.getException() != null)
          {
-            // Sleep a bit more since it's async
-            // We are not sure about the order in which the listeners are called, so we need another sleep
-            Thread.sleep(PING_INTERVAL);
-
             break;
          }
 
@@ -360,8 +356,7 @@
 
       session.close();
    }
-   
-   
+
    /*
    * Test the client triggering failure due to no pong received in time
    */
@@ -439,14 +434,11 @@
 
       serverConn.addFailureListener(serverListener);
 
-      for (int i = 0; i < 20; i++)
+      for (int i = 0; i < 40; i++)
       {
          // a few tries to avoid a possible race caused by GCs or similar issues
-         if (messagingService.getServer().getRemotingService().getConnections().isEmpty())
+         if (messagingService.getServer().getRemotingService().getConnections().isEmpty() && clientListener.getException() != null)
          {
-            // Sleep a bit more since it's async
-            // We are not sure about the order in which the listeners are called, so we need another sleep
-            Thread.sleep(PING_INTERVAL);
             break;
          }
 




More information about the jboss-cvs-commits mailing list