[jboss-cvs] JBoss Messaging SVN: r2486 - in trunk/tests: src/org/jboss/test/messaging/jms/clustering and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 27 22:28:50 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-02-27 22:28:49 -0500 (Tue, 27 Feb 2007)
New Revision: 2486

Modified:
   trunk/tests/build.xml
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
Log:
Fixed runaway clustering server.
This is what happened:

The ant script used to pre-stage 4 servers (0, 1, 2, 3) for clustering tests.
While running ClusteredConnectionFactoryTest, server 0 (the one that runs the
RMI registry) would be killed, so even if restarted later to give a 
RMI registry to the test, server 3, which is not used during the test, will
become stranded, and the cleanup sequence won't stop it.

Solution: don't prestage servers. Let the test start the servers it needs.


Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml	2007-02-28 02:30:33 UTC (rev 2485)
+++ trunk/tests/build.xml	2007-02-28 03:28:49 UTC (rev 2486)
@@ -709,79 +709,11 @@
 
    </target>
 
-   <!-- internal task for clustering-tests -->
-   <target name="start-clustering">
-      <!-- Stop the rmi servers in case a previous run aborted -->
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="3"/>
-      </antcall>
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="2"/>
-      </antcall>
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="1"/>
-      </antcall>
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="0"/>
-      </antcall>
-
-
-
-      <!-- Start 4 rmi servers -->
-
-      <antcall target="start-rmi-server-clustering">
-         <param name="test.server.index" value="0"/>
-      </antcall>
-
-      <antcall target="start-rmi-server-clustering">
-         <param name="test.server.index" value="1"/>
-      </antcall>
-
-      <antcall target="start-rmi-server-clustering">
-         <param name="test.server.index" value="2"/>
-      </antcall>
-
-      <antcall target="start-rmi-server-clustering">
-         <param name="test.server.index" value="3"/>
-      </antcall>
-
-      <mkdir dir="${build.tests.reports}"/>
-
-
-   </target>
-
-   <!-- internal task for clustering-tests -->
-   <target name="stop-clustering">
-      <!--
-          Stop the servers in the reverse order, so the VM that runs the RMI registry dies last.
-      -->
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="3"/>
-      </antcall>
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="2"/>
-      </antcall>
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="1"/>
-      </antcall>
-
-      <antcall target="stop-rmi-server-clustering">
-         <param name="test.server.index" value="0"/>
-      </antcall>
-   </target>
-
    <target name="clustering-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
            description="Runs the clustering tests">
 
 
-      <antcall target="start-clustering"/>
+      <mkdir dir="${build.tests.reports}"/>
 
       <echo message=""/>
       <echo message="Running clustering tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
@@ -842,16 +774,13 @@
             </fileset>
          </batchtest>
       </junit>
-
-      <antcall target="stop-clustering"/>
-
    </target>
 
    <target name="memory-leak-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
            description="Runs MemoryLeakTests, but it starts the clustering for leak-clustering-tests">
 
 
-      <antcall target="start-clustering"/>
+      <mkdir dir="${build.tests.reports}"/>
 
       <echo message=""/>
       <echo message="Running clustering tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
@@ -913,8 +842,6 @@
          </batchtest>
       </junit>
 
-      <antcall target="stop-clustering"/>
-
    </target>
 
    <target name="crash-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java	2007-02-28 02:30:33 UTC (rev 2485)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java	2007-02-28 03:28:49 UTC (rev 2486)
@@ -90,7 +90,7 @@
          }
 
          // need to re-start 0, it's the RMI server the other servers use
-         ServerManagement.start(0, "all");
+         ServerManagement.start(0, "all", true);
       }
    }
 
@@ -207,6 +207,8 @@
    {
       nodeCount = 3;
       super.setUp();
+
+      log.debug("setup done");
    }
 
    protected void tearDown() throws Exception
@@ -216,15 +218,14 @@
 
    // Private --------------------------------------------------------------------------------------
 
-   private void resetAOP()
-      throws NoSuchFieldException, IllegalAccessException
+   private void resetAOP() throws NoSuchFieldException, IllegalAccessException
    {
 
       // Using reflection to cleanup AOP status and force to load AOP again
       Field field = ClientAOPStackLoader.class.getDeclaredField("instance");
       field.setAccessible(true);
       log.info("Reseting AOP");
-      field.set(null,null);
+      field.set(null, null);
    }
 
    // Inner classes --------------------------------------------------------------------------------




More information about the jboss-cvs-commits mailing list