Skip to content

Commit 533d873

Browse files
author
Amos Shi
committed
8315576: compiler/codecache/CodeCacheFullCountTest.java fails after JDK-8314837
Reviewed-by: phh Backport-of: 343cc0ce2bba797e206f6b7312018a8c6d1bdb66
1 parent dade22a commit 533d873

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ public static void main(String args[]) throws Throwable {
4545
}
4646
}
4747

48-
public static void wasteCodeCache() throws Exception {
48+
public static void wasteCodeCache() throws Throwable {
4949
URL url = CodeCacheFullCountTest.class.getProtectionDomain().getCodeSource().getLocation();
5050

51-
for (int i = 0; i < 500; i++) {
52-
ClassLoader cl = new MyClassLoader(url);
53-
refClass(cl.loadClass("SomeClass"));
51+
try {
52+
for (int i = 0; i < 500; i++) {
53+
ClassLoader cl = new MyClassLoader(url);
54+
refClass(cl.loadClass("SomeClass"));
55+
}
56+
} catch (Throwable t) {
57+
// Expose the root cause of the Throwable instance.
58+
while (t.getCause() != null) {
59+
t = t.getCause();
60+
}
61+
throw t;
5462
}
5563
}
5664

@@ -59,7 +67,7 @@ public static void runTest() throws Throwable {
5967
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
6068
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
6169
// Ignore adapter creation failures
62-
if (oa.getExitValue() != 0 && !oa.getStderr().contains("Out of space in CodeCache for adapters")) {
70+
if (oa.getExitValue() != 0 && !oa.getOutput().contains("Out of space in CodeCache for adapters")) {
6371
oa.reportDiagnosticSummary();
6472
throw new RuntimeException("VM finished with exit code " + oa.getExitValue());
6573
}

0 commit comments

Comments
 (0)