On 07.02.2012 17:18, Katherine Marsden wrote:
On 2/7/2012 2:55 AM, Kristian Waagan wrote:

(net)derbynet.SecureServerTest.testServerStartup used 6750 ms E.
(net)derbynet.SecureServerTest.testServerStartup used 46827 ms F.


Is the stack trace ([1]) for the first SecureServerStartup, or for the
second one?
If from the second one, what's the error for the first?
And, do you know where the interrupt comes from?
Did you manually kill/interrupt the test run, or did it die on its own?
think it is from the first one:
Full output is at:
http://people.apache.org/~myrnavl/derby_test_results/main/windows/testlog/ibm15/1240879-suites.All_diff.txt
And, do you know where the interrupt comes from?
It seems related somehow to launching a process with cygwin on that
particuar machine.

Did you manually kill/interrupt the test run, or did it die on its own?

Once NativeAuthenticationServiceTest was disabled the tests ran through
to completion but with 75-77 failures and 817 errors as you can see from
the above run.

Thanks, Kathey.

If you're interested, you can try to apply the attached patch ([1]) and see if the logs contain any useful information. The patch catches the interrupt and tries to collect any output on the subprocess' stdout and stderr before killing the process. Depending on what's going on, there may be nothing there.
I've only tested the patch with SecureServerTest.


--
Kristian

[1] It's a git patch, use -p1 with patch when applying.





diff --git a/java/testing/org/apache/derbyTesting/junit/SpawnedProcess.java 
b/java/testing/org/apache/derbyTesting/junit/SpawnedProcess.java
index 469ed91..f3b6c14 100644
--- a/java/testing/org/apache/derbyTesting/junit/SpawnedProcess.java
+++ b/java/testing/org/apache/derbyTesting/junit/SpawnedProcess.java
@@ -33,6 +33,10 @@
  */
 public final class SpawnedProcess {
 
+    private static final long NO_TIMEOUT = 0;
+    private static final long REASONABLE_TIMEOUT = 30*1000;
+    private static final int INTERRUPTED = -1;
+
     private final String name;
 
     private final Process javaProcess;
@@ -181,11 +185,20 @@
         if (destroy)
             javaProcess.destroy();
 
-        exitCode = javaProcess.waitFor();
+        long joinTimeout = NO_TIMEOUT;
+        // Catch the interrupt here to write output from the subprocess'
+        // stderr and stdout for debugging purposes.
+        try {
+            exitCode = javaProcess.waitFor();
+        } catch (InterruptedException ie) {
+            // Set a timeout so we don't hang indefinitely.
+            joinTimeout = REASONABLE_TIMEOUT;
+            exitCode = INTERRUPTED;
+        }
 
         // The process has completed. Wait until we've read all output.
-        outSaver.thread.join();
-        errSaver.thread.join();
+        outSaver.thread.join(joinTimeout);
+        errSaver.thread.join(joinTimeout);
 
         synchronized (this) {
 
@@ -197,8 +210,8 @@
                 System.err.println("END-SPAWNED  :" + name + " ERROR OUTPUT:");
             }
 
-            // Only write the error if it appeared the server
-            // failed in some way.
+            // Only write the output from stdout if it appeared
+            // the server failed in some way.
             ByteArrayOutputStream out = outSaver.stream;
             if ((destroy || exitCode != 0) && out.size() != 0) {
                 System.out.println("START-SPAWNED:" + name
@@ -208,6 +221,20 @@
                         + " STANDARD OUTPUT:");
             }
         }
+
+        // If we caught an interrupt, rethrow it here after making sure
+        // the process is killed.
+        if (exitCode == INTERRUPTED) {
+            int tmpExitCode = -1;
+            try {
+                tmpExitCode = javaProcess.exitValue();
+            } catch (IllegalThreadStateException itse) {
+                javaProcess.destroy();
+            }
+            throw new InterruptedException(
+                tmpExitCode == -1 ? "destroyed process"
+                                  : "process exited with code " + tmpExitCode);
+        }
         
         return exitCode;
     }

Reply via email to