jdk/test/com/sun/tools/attach/TempDirTest.java
changeset 25155 8b98011eac74
parent 24509 5d02a6d25f78
child 25182 1f6766bac82c
--- a/jdk/test/com/sun/tools/attach/TempDirTest.java	Mon Jun 23 10:57:22 2014 +0400
+++ b/jdk/test/com/sun/tools/attach/TempDirTest.java	Mon Jun 23 15:51:41 2014 +0200
@@ -39,13 +39,22 @@
  * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
  * @library /lib/testlibrary
  * @run build jdk.testlibrary.* Application Shutdown RunnerUtil
- * @run main TempDirTest
+ * @run main/timeout=200 TempDirTest
+ */
+
+/*
+ * This test runs with an extra long timeout since it takes a really long time with -Xcomp
+ * when starting many processes.
  */
 
 public class TempDirTest {
 
+    private static long startTime;
+
     public static void main(String args[]) throws Throwable {
 
+        startTime = System.currentTimeMillis();
+
         Path clientTmpDir = Files.createTempDirectory("TempDirTest-client");
         clientTmpDir.toFile().deleteOnExit();
         Path targetTmpDir = Files.createTempDirectory("TempDirTest-target");
@@ -76,6 +85,9 @@
         System.out.print(" target: " + (targetTmpDir == null ? "no" : "yes"));
         System.out.println(" ###");
 
+        long elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
+        System.out.println("Started after " + elapsedTime + "s");
+
         final String pidFile = "TempDirTest.Application.pid-" + counter++;
         ProcessThread processThread = null;
         RunnerUtil.ProcessInfo info = null;
@@ -95,6 +107,10 @@
             // Make sure the Application process is stopped.
             RunnerUtil.stopApplication(info.shutdownPort, processThread);
         }
+
+        elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
+        System.out.println("Completed after " + elapsedTime + "s");
+
     }
 
     /**