[Jboss-cvs] JBossAS SVN: r56926 - trunk/testsuite/src/main/org/jboss/test/testbeancluster/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Sep 17 23:49:56 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-09-17 23:49:55 -0400 (Sun, 17 Sep 2006)
New Revision: 56926

Modified:
   trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/BeanUnitTestCase.java
Log:
Remove unreliable max call time test; don't reinvoke on a bean once it's been timed out and removed

Modified: trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/BeanUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/BeanUnitTestCase.java	2006-09-18 03:44:47 UTC (rev 56925)
+++ trunk/testsuite/src/main/org/jboss/test/testbeancluster/test/BeanUnitTestCase.java	2006-09-18 03:49:55 UTC (rev 56926)
@@ -332,6 +332,8 @@
       {
          int id = n % beans.length;
          StatefulSession bean = beans[id];
+         if (bean == null)
+            continue;
          String name = "testStatefulPassiviationExpiration#"+id;
          long callStart = System.currentTimeMillis();
          long inactive = callStart - accessStamp[id];
@@ -351,6 +353,8 @@
          catch (java.rmi.NoSuchObjectException nso)
          {
             log.debug(n+" Caught NoSuchObjectException on bean " + id + " -- inactive time = " + inactive);
+            // Remove from list so we don't keep fruitlessly calling the removed bean
+            beans[id] = null;
          }
       }
       log.info(N+" calls complete, max="+max+", min="+min+", maxInactive="+maxInactive);
@@ -368,6 +372,8 @@
       {
          int id = n % beans.length;
          StatefulSession bean = beans[id];
+         if (bean == null)
+            continue;
          String name = "testStatefulPassiviationExpiration#"+id;
          long callStart = System.currentTimeMillis();
          long inactive = callStart - accessStamp[id];
@@ -387,16 +393,20 @@
          catch (java.rmi.NoSuchObjectException nso)
          {
             log.debug(n+" Caught NoSuchObjectException on bean " + id + " -- inactive time = " + (callStart - accessStamp[id]));
+            // Remove from list so we don't keep fruitlessly calling the removed bean
+            beans[id] = null;
          }
       }
       log.info(N+" calls complete, max="+max+", min="+min+", maxInactive="+maxInactive);
-      assertTrue("max < 3000", max < 3000 );
+      // BES -- max call time check removed, as it can randomly fail if there is a long GC pause
+      // assertTrue("max < 3000", max < 3000 );
 
       for(int n = 0; n < beans.length; n ++)
       {
          try
          {
-            beans[n].remove();
+            if (beans[n] != null)
+               beans[n].remove();
          }
          catch (java.rmi.NoSuchObjectException nso)
          {




More information about the jboss-cvs-commits mailing list