jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java
changeset 36233 f85ed703cf7e
parent 35768 7066da300a08
child 36956 f4ba8a865e4b
--- a/jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java	Thu Mar 03 10:39:34 2016 -0800
+++ b/jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java	Thu Mar 03 10:43:07 2016 -0800
@@ -35,11 +35,12 @@
  * @test
  * @bug 8074773
  * @summary Stress test looks for lost unparks
+ * @library /lib/testlibrary/
  * @modules java.management
- * @run main/timeout=1200 ParkLoops
  */
 
-import static java.util.concurrent.TimeUnit.SECONDS;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
 import java.lang.management.ManagementFactory;
 import java.lang.management.ThreadInfo;
 import java.util.SplittableRandom;
@@ -49,13 +50,12 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReferenceArray;
 import java.util.concurrent.locks.LockSupport;
+import jdk.testlibrary.Utils;
 
 public final class ParkLoops {
+    static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
     static final int THREADS = 4;
-    // static final int ITERS = 2_000_000;
-    // static final int TIMEOUT = 3500;  // in seconds
-    static final int ITERS = 100_000;
-    static final int TIMEOUT = 1000;  // in seconds
+    static final int ITERS = 30_000;
 
     static class Parker implements Runnable {
         static {
@@ -130,13 +130,13 @@
             pool.submit(unparker);
         }
         try {
-          if (!done.await(TIMEOUT, SECONDS)) {
+          if (!done.await(LONG_DELAY_MS, MILLISECONDS)) {
             dumpAllStacks();
             throw new AssertionError("lost unpark");
           }
         } finally {
           pool.shutdown();
-          pool.awaitTermination(10L, SECONDS);
+          pool.awaitTermination(LONG_DELAY_MS, MILLISECONDS);
         }
     }