[jboss-cvs] JBossAS SVN: r107677 - trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 19 00:04:26 EDT 2010


Author: bstansberry at jboss.com
Date: 2010-08-19 00:04:26 -0400 (Thu, 19 Aug 2010)
New Revision: 107677

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java
Log:
Make test less timing sensitive

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java	2010-08-19 03:05:42 UTC (rev 107676)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java	2010-08-19 04:04:26 UTC (rev 107677)
@@ -175,38 +175,40 @@
    
    private void validateFinalState() throws Exception
    {
+      // All deployments should be detected by HDScanner, replicated, and
+      // picked up and deployed by HDScanner on other node w/in 2 HDScanner
+      // runs (20 secs) + a 10% fudge factor      
+      long deadline = System.currentTimeMillis() + 22000;
+      
       // Simple add
-      // For this one we give a long timeout; once this one passes all the others
-      // should be there as well, since we stop the scanner during the mods
-      // and do them all at once
-      checkContent("jboss.system:service=HDAddTestThreadPool", "AddFarmThreadPool", 12000);
+      checkContent("jboss.system:service=HDAddTestThreadPool", "AddFarmThreadPool", deadline);
       
       // Nested add
-      checkContent("jboss.system:service=HDNestedAddTestThreadPool", "NestedAddFarmThreadPool", 10000);
+      checkContent("jboss.system:service=HDNestedAddTestThreadPool", "NestedAddFarmThreadPool", deadline);
       
       // New dir
-      checkContent("jboss.system:service=HDAddDirTestThreadPool", "AddDirFarmThreadPool", 0);
+      checkContent("jboss.system:service=HDAddDirTestThreadPool", "AddDirFarmThreadPool", deadline);
       
       // New zip
-      checkWebContent("/hd-add-zipped/index.html", HttpURLConnection.HTTP_OK, 0);
+      checkWebContent("/hd-add-zipped/index.html", HttpURLConnection.HTTP_OK, deadline);
       
       // Simple removal
-      checkContentRemoved("jboss.system:service=HDRemoveTestThreadPool", 0);
+      checkContentRemoved("jboss.system:service=HDRemoveTestThreadPool", deadline);
       
       // Nested removal
-      checkContentRemoved("jboss.system:service=HDNestedRemoveTestThreadPool", 0);
+      checkContentRemoved("jboss.system:service=HDNestedRemoveTestThreadPool", deadline);
       
       // Dir removal
-      checkContentRemoved("jboss.system:service=HDRemoveDirFarmTestThreadPool", 0);
+      checkContentRemoved("jboss.system:service=HDRemoveDirFarmTestThreadPool", deadline);
       
       // Nested mod
-      checkContent("jboss.system:service=HDModifyNestedTestThreadPool", "ModifiedNestedFarmThreadPool", 0);
+      checkContent("jboss.system:service=HDModifyNestedTestThreadPool", "ModifiedNestedFarmThreadPool", deadline);
       
       // Simple mod
-      checkContent("jboss.system:service=HDModifyTestThreadPool", "ModifiedFarmThreadPool", 0);
+      checkContent("jboss.system:service=HDModifyTestThreadPool", "ModifiedFarmThreadPool", deadline);
       
       // Zipped mod
-      checkWebContent("/hd-mod-zipped/index.html", HttpURLConnection.HTTP_OK, 0);
+      checkWebContent("/hd-mod-zipped/index.html", HttpURLConnection.HTTP_OK, deadline);
    }
 
    /**
@@ -295,7 +297,7 @@
       }
    }
    
-   private void checkContent(String objectName, String poolName, long timeout) throws Exception
+   private void checkContent(String objectName, String poolName, long deadline) throws Exception
    {
       boolean node0OK = false;
       boolean node1OK = false;
@@ -303,7 +305,7 @@
       MBeanServerConnection[] adaptors = getAdaptors();
       ObjectName oname = new ObjectName(objectName);
       
-      long deadline = System.currentTimeMillis() + timeout;
+//      long deadline = System.currentTimeMillis() + timeout;
       do
       {
          if (!node0OK)
@@ -336,7 +338,7 @@
       assertTrue(objectName + " -- node1 OK", node1OK);
    }
    
-   private void checkContentRemoved(String objectName, long timeout) throws Exception
+   private void checkContentRemoved(String objectName, long deadline) throws Exception
    {
       boolean node0OK = false;
       boolean node1OK = false;
@@ -344,7 +346,7 @@
       MBeanServerConnection[] adaptors = getAdaptors();
       ObjectName oname = new ObjectName(objectName);
       
-      long deadline = System.currentTimeMillis() + 12000;
+//      long deadline = System.currentTimeMillis() + 12000;
       do
       {
          if (!node0OK)
@@ -377,7 +379,7 @@
       assertTrue(objectName + " -- node1 OK", node1OK);
    }
    
-   private void checkWebContent(String relativePath, int expectedResponse, long timeout) throws Exception
+   private void checkWebContent(String relativePath, int expectedResponse, long deadline) throws Exception
    {
       boolean node0OK = false;
       boolean node1OK = false;
@@ -386,7 +388,7 @@
       GetMethod get0 = new GetMethod(hosts[0] + relativePath);
       GetMethod get1 = new GetMethod(hosts[1] + relativePath);
       
-      long deadline = System.currentTimeMillis() + timeout;
+//      long deadline = System.currentTimeMillis() + timeout;
       do
       {
          if (!node0OK)



More information about the jboss-cvs-commits mailing list