Merge
authorsspitsyn
Tue, 22 Mar 2016 21:27:55 +0000
changeset 37323 e41872ef1390
parent 37321 d069569242e3 (diff)
parent 37322 696304418137 (current diff)
child 37324 78e60b834fa4
Merge
--- a/jdk/test/com/sun/jdi/InterruptHangTest.java	Mon Mar 21 11:24:09 2016 +0100
+++ b/jdk/test/com/sun/jdi/InterruptHangTest.java	Tue Mar 22 21:27:55 2016 +0000
@@ -153,14 +153,17 @@
         timerThread = new Thread("test timer") {
                 public void run() {
                     int mySteps = 0;
+                    float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0"));
+                    long sleepSeconds = (long)(20 * timeoutFactor);
+                    println("Timer watching for steps every " + sleepSeconds + " seconds");
                     while (true) {
                         try {
-                            Thread.sleep(20000);
+                            Thread.sleep(sleepSeconds * 1000);
                             synchronized(sync) {
-                                System.out.println("steps = " + nSteps);
+                                println("steps = " + nSteps);
                                 if (mySteps == nSteps) {
-                                    // no step for 10 secs
-                                    failure("failure: Debuggee appears to be hung");
+                                    // no step for a long time
+                                    failure("failure: Debuggee appears to be hung (no steps for " + sleepSeconds + "s)");
                                     vm().exit(-1);
                                     break;
                                 }
--- a/jdk/test/com/sun/jdi/ShellScaffold.sh	Mon Mar 21 11:24:09 2016 +0100
+++ b/jdk/test/com/sun/jdi/ShellScaffold.sh	Tue Mar 22 21:27:55 2016 +0000
@@ -131,6 +131,9 @@
 
 # This can be increased if timing seems to be an issue.
 sleep_seconds=1
+if [ -n "$TIMEOUT_FACTOR" ] ; then
+  sleep_seconds=$(echo $TIMEOUT_FACTOR $sleep_seconds | awk '{printf "%d\n", int($1 * $2)}')
+fi
 
 echo "ShellScaffold.sh: Version" >& 2
 topPid=$$
--- a/jdk/test/com/sun/jdi/TestScaffold.java	Mon Mar 21 11:24:09 2016 +0100
+++ b/jdk/test/com/sun/jdi/TestScaffold.java	Tue Mar 22 21:27:55 2016 +0000
@@ -64,6 +64,7 @@
     boolean vmDisconnected = false;
     final String[] args;
     protected boolean testFailed = false;
+    protected long startTime;
 
     static private class ArgInfo {
         String targetVMArgs = "";
@@ -425,6 +426,7 @@
     abstract protected void runTests() throws Exception;
 
     final public void startTests() throws Exception {
+        startTime = System.currentTimeMillis();
         try {
             runTests();
         } finally {
@@ -433,7 +435,8 @@
     }
 
     protected void println(String str) {
-        System.err.println(str);
+        long elapsed = System.currentTimeMillis() - startTime;
+        System.err.println("[" + elapsed + "ms] " + str);
     }
 
     protected void print(String str) {