jdk/test/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java
changeset 36233 f85ed703cf7e
parent 34347 4a17f9e90a0f
--- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java	Thu Mar 03 10:39:34 2016 -0800
+++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/FlakyThreadFactory.java	Thu Mar 03 10:43:07 2016 -0800
@@ -35,14 +35,20 @@
 /*
  * @test
  * @summary Should be able to shutdown a pool when worker creation failed.
+ * @library /lib/testlibrary/
  */
 
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
+import jdk.testlibrary.Utils;
 
 public class FlakyThreadFactory {
+    static final long LONG_DELAY_MS = Utils.adjustTimeout(10_000);
+
     void test(String[] args) throws Throwable {
         test(NullPointerException.class,
              new ThreadFactory() {
@@ -89,7 +95,7 @@
             check(exceptionClass.isInstance(t));
         }
         pool.shutdown();
-        check(pool.awaitTermination(10L, TimeUnit.SECONDS));
+        check(pool.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
     }
 
     //--------------------- Infrastructure ---------------------------