Skip to content

Commit

Permalink
8069343: Improve gc/g1/TestHumongousCodeCacheRoots.java to use jtreg @…
Browse files Browse the repository at this point in the history
…requires

Remove client test entirely and clean up test

Backport-of: ec76c20
  • Loading branch information
GoeLin committed Jun 10, 2022
1 parent a87bfb8 commit cc6137c
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions test/hotspot/jtreg/gc/g1/TestHumongousCodeCacheRoots.java
Expand Up @@ -121,35 +121,20 @@ public static OutputAnalyzer runWhiteBoxTest(String[] vmargs, String classname,

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs.toArray(new String[0]));
OutputAnalyzer output = new OutputAnalyzer(pb.start());
try {
output.shouldHaveExitValue(0);
} catch (RuntimeException e) {
// It's ok if there is no client vm in the jdk.
if (output.firstMatch("Unrecognized option: -client") == null) {
throw e;
}
}

output.shouldHaveExitValue(0);
return output;
}

public static void runTest(String compiler, String[] other) throws Exception {
ArrayList<String> joined = new ArrayList<String>();
joined.add(compiler);
joined.addAll(Arrays.asList(other));
runWhiteBoxTest(joined.toArray(new String[0]), TestHumongousCodeCacheRootsHelper.class.getName(),
new String[] {}, false);
}

public static void main(String[] args) throws Exception {
final String[] baseArguments = new String[] {
"-XX:+UseG1GC", "-XX:G1HeapRegionSize=1M", "-Xmx100M", // make sure we get a humongous region
"-XX:+UnlockDiagnosticVMOptions",
"-XX:InitiatingHeapOccupancyPercent=1", // strong code root marking
"-XX:+G1VerifyHeapRegionCodeRoots", "-XX:+VerifyAfterGC", // make sure that verification is run
};
runTest("-client", baseArguments);
runTest("-server", baseArguments);

runWhiteBoxTest(baseArguments, TestHumongousCodeCacheRootsHelper.class.getName(),
new String[] {}, false);
}
}

1 comment on commit cc6137c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.