db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1103742 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilityCombinations.java
Date Mon, 16 May 2011 14:00:02 GMT
Author: kahatlen
Date: Mon May 16 14:00:01 2011
New Revision: 1103742

URL: http://svn.apache.org/viewvc?rev=1103742&view=rev
Log:
DERBY-5222: Compatibility tests fail to delete database directory

Wait for all forked processes to complete before testing the next combination.

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

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=1103742&r1=1103741&r2=1103742&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
Mon May 16 14:00:01 2011
@@ -237,6 +237,9 @@ public class CompatibilityCombinations e
     private static boolean includeUpgrade = false;
     
     private static long SLEEP_TIME_MILLIS = 5000L;
+
+    /** The process in which the network server is running. */
+    private Process serverProc;
     
     /**
      * Creates a new instance of CompatibilityCombinations
@@ -1025,12 +1028,11 @@ public class CompatibilityCombinations e
             {
                 public void run()
                 {
-                    Process proc = null;
                     try
                     {
                         DEBUG("************** In run().");
-                        proc = Runtime.getRuntime().exec(fullCmd,envElements,workingDir);
-                        // proc = Runtime.getRuntime().exec(commandElements,envElements,workingDir);
+                        serverProc = Runtime.getRuntime().
+                                exec(fullCmd, envElements, workingDir);
                         DEBUG("************** Done exec().");
                     }
                     catch (Exception ex)
@@ -1146,9 +1148,8 @@ public class CompatibilityCombinations e
         try
         {
             Process proc = Runtime.getRuntime().exec(fullCmd,envElements,workingDir);
-            proc.waitFor();
             processDEBUGOutput(proc);
-                        
+            proc.waitFor();
         }
         catch (Exception ex)
         {
@@ -1269,9 +1270,14 @@ public class CompatibilityCombinations e
                 );
             try
             {
+                // Tell the server to stop.
                 Process proc = Runtime.getRuntime().exec(fullCmd,envElements,workingDir);
                 processDEBUGOutput(proc);
-                
+                proc.waitFor();
+
+                // Now wait for it to actually stop.
+                serverProc.waitFor();
+                serverProc = null;
             }
             catch (Exception ex)
             {
@@ -1342,7 +1348,7 @@ public class CompatibilityCombinations e
         {
             Process proc = Runtime.getRuntime().exec(fullCmd,envElements,workingDir);
             processOutput(proc, out);
-            
+            proc.waitFor();
         }
         catch (Exception ex)
         {
@@ -1402,7 +1408,7 @@ public class CompatibilityCombinations e
         {
             Process proc = Runtime.getRuntime().exec(fullCmd,envElements,workingDir);
             processOutput(proc, out);
-            
+            proc.waitFor();
         }
         catch (Exception ex)
         {



Mime
View raw message