8315576: compiler/codecache/CodeCacheFullCountTest.java fails after JDK-8314837

Reviewed-by: kvn, thartmann
This commit is contained in:
Yi-Fan Tsai 2023-09-22 07:57:05 +00:00 committed by Tobias Hartmann
parent fe862639e7
commit 343cc0ce2b
2 changed files with 13 additions and 7 deletions
test/hotspot/jtreg

@ -27,8 +27,6 @@
#
#############################################################################
compiler/codecache/CodeCacheFullCountTest.java 8315576 generic-all
vmTestbase/nsk/jvmti/AttachOnDemand/attach020/TestDescription.java 8287324 generic-all
vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java 8205957 generic-all
vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw001/TestDescription.java 8205957 linux-x64,windows-x64

@ -45,12 +45,20 @@ public class CodeCacheFullCountTest {
}
}
public static void wasteCodeCache() throws Exception {
public static void wasteCodeCache() throws Throwable {
URL url = CodeCacheFullCountTest.class.getProtectionDomain().getCodeSource().getLocation();
for (int i = 0; i < 500; i++) {
ClassLoader cl = new MyClassLoader(url);
refClass(cl.loadClass("SomeClass"));
try {
for (int i = 0; i < 500; i++) {
ClassLoader cl = new MyClassLoader(url);
refClass(cl.loadClass("SomeClass"));
}
} catch (Throwable t) {
// Expose the root cause of the Throwable instance.
while (t.getCause() != null) {
t = t.getCause();
}
throw t;
}
}
@ -59,7 +67,7 @@ public class CodeCacheFullCountTest {
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "-XX:-MethodFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
// Ignore adapter creation failures
if (oa.getExitValue() != 0 && !oa.getStderr().contains("Out of space in CodeCache for adapters")) {
if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache for adapters")) {
oa.reportDiagnosticSummary();
throw new RuntimeException("VM finished with exit code " + oa.getExitValue());
}