提交 befb3990 编写于 作者: P poonam

8076995: gc/ergonomics/TestDynamicNumberOfGCThreads.java failed with...

8076995: gc/ergonomics/TestDynamicNumberOfGCThreads.java failed with java.lang.RuntimeException: 'new_active_workers' missing from stdout/stderr
Reviewed-by: jmasa, drwhite
上级 cd243810
......@@ -193,8 +193,9 @@ int AdaptiveSizePolicy::calc_active_workers(uintx total_workers,
(!FLAG_IS_DEFAULT(ParallelGCThreads) && !ForceDynamicNumberOfGCThreads)) {
new_active_workers = total_workers;
} else {
uintx min_workers = (total_workers == 1) ? 1 : 2;
new_active_workers = calc_default_active_workers(total_workers,
2, /* Minimum number of workers */
min_workers,
active_workers,
application_workers);
}
......
......@@ -215,6 +215,7 @@ needs_full_vm_compact1 = \
runtime/NMT \
gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java \
gc/class_unloading/TestG1ClassUnloadingHWM.java \
gc/ergonomics/TestDynamicNumberOfGCThreads.java \
gc/g1/TestRegionAlignment.java \
gc/g1/TestShrinkToOneRegion.java \
gc/metaspace/G1AddMetaspaceDependency.java \
......
......@@ -44,14 +44,24 @@ public class TestDynamicNumberOfGCThreads {
}
private static void verifyDynamicNumberOfGCThreads(OutputAnalyzer output) {
output.shouldHaveExitValue(0); // test should run succesfully
output.shouldContain("new_active_workers");
output.shouldHaveExitValue(0);
}
private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception {
// UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled
ProcessBuilder pb_enabled =
ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-Xmx10M", "-XX:+PrintGCDetails", "-XX:+UseDynamicNumberOfGCThreads", "-XX:+TraceDynamicGCThreads", GCTest.class.getName());
String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+PrintGCDetails", "-XX:+UseDynamicNumberOfGCThreads", "-XX:+TraceDynamicGCThreads", GCTest.class.getName()};
// Base test with gc and +UseDynamicNumberOfGCThreads:
ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs);
verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start()));
// Ensure it also works on uniprocessors or if user specifies -XX:ParallelGCThreads=1:
String[] extraArgs = {"-XX:+UnlockDiagnosticVMOptions", "-XX:+ForceDynamicNumberOfGCThreads", "-XX:ParallelGCThreads=1"};
String[] finalArgs = new String[baseArgs.length + extraArgs.length];
System.arraycopy(extraArgs, 0, finalArgs, 0, extraArgs.length);
System.arraycopy(baseArgs, 0, finalArgs, extraArgs.length, baseArgs.length);
pb_enabled = ProcessTools.createJavaProcessBuilder(finalArgs);
verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start()));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册