--- old/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java 2016-02-19 19:51:44.000000000 +0300 +++ new/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java 2016-02-19 19:51:44.000000000 +0300 @@ -27,21 +27,19 @@ * @summary Tests jcmd to be able to add a lot of huge directive files with * parallel executed jcmds until timeout has reached * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @ignore 8148563 * @build compiler.compilercontrol.jcmd.StressAddMultiThreadedTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils * compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm/timeout=360 compiler.compilercontrol.jcmd.StressAddMultiThreadedTest + * @run main/othervm/timeout=360 -Xmixed compiler.compilercontrol.jcmd.StressAddMultiThreadedTest */ package compiler.compilercontrol.jcmd; import jdk.test.lib.dcmd.PidJcmdExecutor; -import java.util.List; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; @@ -54,9 +52,9 @@ private final ExecutorService executor; static { - THREADS = Runtime.getRuntime().availableProcessors() - * Integer.getInteger("compiler.compilercontrol.jcmd" + - ".StressAddMultiThreadedTest.threadFactor", 10); + THREADS = (int) (Math.log(Runtime.getRuntime().availableProcessors() + * Integer.getInteger("compiler.compilercontrol.jcmd" + + ".StressAddMultiThreadedTest.threadFactor", 10))); } public StressAddMultiThreadedTest() { @@ -64,6 +62,7 @@ executor = new ThreadPoolExecutor(THREADS, THREADS, 100, TimeUnit.MILLISECONDS, queue, new ThreadPoolExecutor.CallerRunsPolicy()); + System.out.println("INFO: stress threads: " + THREADS); } public static void main(String[] args) { @@ -71,13 +70,11 @@ } @Override - protected boolean makeConnection(int pid, List commands) { - commands.forEach(command -> { - if (!executor.isShutdown()) { - executor.submit(() -> new PidJcmdExecutor(String.valueOf(pid)) - .execute(command)); - } - }); + protected boolean makeConnection(int pid) { + if (!executor.isShutdown()) { + executor.submit(() -> new PidJcmdExecutor(String.valueOf(pid)) + .execute(nextCommand())); + } return !executor.isShutdown(); } @@ -85,7 +82,7 @@ protected void finish() { executor.shutdown(); try { - executor.awaitTermination(10, TimeUnit.SECONDS); + executor.awaitTermination(1, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new Error("Interrupted while awaiting for termination: " + e, e);