changeset 14097:49dfb7d3f6c9

8151501: LockSupport/ParkLoops.java: AssertionError: lost unpark Reviewed-by: martin, psandoz, dholmes, forax
author dl
date Thu, 07 Apr 2016 10:06:01 -0700
parents 596b4307e193
children a933dec23384
files test/java/util/concurrent/locks/LockSupport/ParkLoops.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/util/concurrent/locks/LockSupport/ParkLoops.java	Thu Apr 07 10:01:36 2016 -0700
+++ b/test/java/util/concurrent/locks/LockSupport/ParkLoops.java	Thu Apr 07 10:06:01 2016 -0700
@@ -37,9 +37,11 @@
  * @summary Stress test looks for lost unparks
  * @library /lib/testlibrary/
  * @modules java.management
+ * @run main/timeout=1200 ParkLoops
  */
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.SECONDS;
 
 import java.lang.management.ManagementFactory;
 import java.lang.management.ThreadInfo;
@@ -53,6 +55,7 @@
 import jdk.testlibrary.Utils;
 
 public final class ParkLoops {
+    static final long TEST_TIMEOUT_SECONDS = Utils.adjustTimeout(1000);
     static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
     static final int THREADS = 4;
     static final int ITERS = 30_000;
@@ -130,7 +133,7 @@
             pool.submit(unparker);
         }
         try {
-          if (!done.await(LONG_DELAY_MS, MILLISECONDS)) {
+          if (!done.await(TEST_TIMEOUT_SECONDS, SECONDS)) {
             dumpAllStacks();
             throw new AssertionError("lost unpark");
           }