db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1302811 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests: jdbcapi/AutoloadTest.java junitTests/compatibility/CompatibilityCombinations.java replicationTests/ReplicationRun.java
Date Tue, 20 Mar 2012 10:12:48 GMT
Author: kahatlen
Date: Tue Mar 20 09:24:36 2012
New Revision: 1302811

URL: http://svn.apache.org/viewvc?rev=1302811&view=rev
Log:
DERBY-5643: Occasional hangs in replication tests on Linux

Replication tests and compatibility tests should fail if ping does not
succeed before timeout.

Negative test case in AutoloadTest should not wait until timeout.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java?rev=1302811&r1=1302810&r2=1302811&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java
Tue Mar 20 09:24:36 2012
@@ -423,8 +423,17 @@ public class AutoloadTest extends BaseJD
         String user = getTestConfiguration().getUserName();
         String pw = getTestConfiguration().getUserPassword();
         NetworkServerControl control = new NetworkServerControl(user, pw);
-        
-        boolean isServerUp = NetworkServerTestSetup.pingForServerStart(control);
+
+        if (!serverShouldBeUp) {
+            // If we expect the server not to come up, wait a little before
+            // checking if the server is up. If the server is (unexpectedly)
+            // coming up and we ping before it has come up, we will conclude
+            // (incorrectly) that it did not come up.
+            Thread.sleep(5000L);
+        }
+
+        boolean isServerUp = NetworkServerTestSetup.pingForServerUp(
+                control, null, serverShouldBeUp);
         
         assertEquals("Network Server state incorrect",
                 serverShouldBeUp, isServerUp);

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java?rev=1302811&r1=1302810&r2=1302811&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java
Tue Mar 20 09:24:36 2012
@@ -1140,8 +1140,7 @@ public class CompatibilityCombinations e
     /**
      * <p>
      * Checks to see that the server is up. If the server doesn't
-     * come up in a reasonable amount of time, (re-)throw the
-     * final exception.
+     * come up in a reasonable amount of time, throw an assert failure.
      * </p>
      * @throws java.lang.Exception .
      */
@@ -1151,7 +1150,9 @@ public class CompatibilityCombinations e
     {
         DEBUG("+++ pingServer");
         NetworkServerControl controller = new NetworkServerControl();
-        NetworkServerTestSetup.pingForServerUp(controller, serverProc, true);
+        assertTrue("Server did not start in time",
+            NetworkServerTestSetup.pingForServerUp(
+                controller, serverProc, true));
         DEBUG("--- pingServer");
     }
     

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java?rev=1302811&r1=1302810&r2=1302811&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/replicationTests/ReplicationRun.java
Tue Mar 20 09:24:36 2012
@@ -2428,7 +2428,8 @@ public class ReplicationRun extends Base
         util.DEBUG("+++ pingServer: " + hostName +":" + port);
         NetworkServerControl controller =
             new NetworkServerControl(InetAddress.getByName(hostName), port);
-        NetworkServerTestSetup.pingForServerStart(controller);
+        assertTrue("Server did not start in time",
+                   NetworkServerTestSetup.pingForServerStart(controller));
         util.DEBUG("--- pingServer: " + hostName +":" + port);
     }
 



Mime
View raw message