8380091: Tests in runtime/cds are failing with log parsing errors - missing output - but the output seems present

Reviewed-by: coleenp, dholmes
This commit is contained in:
Matias Saavedra Silva 2026-04-02 14:10:46 +00:00
parent 06c9aebce3
commit 0ada293cb4
2 changed files with 17 additions and 13 deletions

View File

@ -162,7 +162,7 @@ public class BootAppendTests {
.addSuffix("-Xlog:class+load=info",
APP_CLASS, BOOT_APPEND_DUPLICATE_MODULE_CLASS_NAME);
String MATCH_PATTERN = ".class.load. javax.annotation.processing.FilerException source:.*bootAppend.jar*";
String MATCH_PATTERN = ".class.load.*javax.annotation.processing.FilerException source:.*bootAppend.jar*";
CDSTestUtils.run(opts)
.assertNormalExit(out -> {
out.shouldNotMatch(MATCH_PATTERN);
@ -188,7 +188,7 @@ public class BootAppendTests {
APP_CLASS, BOOT_APPEND_MODULE_CLASS_NAME);
CDSTestUtils.Result res = CDSTestUtils.run(opts);
String MATCH_PATTERN =
".class.load. javax.sound.sampled.MyClass source:.*bootAppend.jar*";
".class.load.*javax.sound.sampled.MyClass source:.*bootAppend.jar*";
if (mode.equals("on")) {
res.assertSilentlyDisabledCDS(out -> {
out.shouldHaveExitValue(0)
@ -225,7 +225,7 @@ public class BootAppendTests {
CDSTestUtils.Result res = CDSTestUtils.run(opts);
String MATCH_PATTERN =
".class.load. javax.annotation.processing.FilerException source:.*bootAppend.jar*";
".class.load.*javax.annotation.processing.FilerException source:.*bootAppend.jar*";
if (mode.equals("on")) {
res.assertSilentlyDisabledCDS(out -> {
out.shouldHaveExitValue(0)
@ -258,7 +258,7 @@ public class BootAppendTests {
CDSTestUtils.Result res = CDSTestUtils.run(opts);
String MATCH_PATTERN =
".class.load. nonjdk.myPackage.MyClass source:.*bootAppend.jar*";
".class.load.*nonjdk.myPackage.MyClass source:.*bootAppend.jar*";
if (mode.equals("on")) {
res.assertSilentlyDisabledCDS(out -> {
out.shouldHaveExitValue(0)
@ -287,7 +287,7 @@ public class BootAppendTests {
CDSTestUtils.Result res = CDSTestUtils.run(opts);
String MATCH_PATTERN =
".class.load. nonjdk.myPackage.MyClass source:.*bootAppend.jar*";
".class.load.*nonjdk.myPackage.MyClass source:.*bootAppend.jar*";
if (mode.equals("on")) {
res.assertSilentlyDisabledCDS(out -> {
out.shouldHaveExitValue(0)

View File

@ -53,8 +53,10 @@ public class SpecifySysLoaderProp {
"-verbose:class",
"-cp", appJar,
"ReportMyLoader")
.assertNormalExit("[class,load] ReportMyLoader source: shared objects file",
"ReportMyLoader's loader = jdk.internal.loader.ClassLoaders$AppClassLoader@");
.assertNormalExit(output -> {
output.shouldMatch(".class,load.*ReportMyLoader source: shared objects file");
output.shouldContain("ReportMyLoader's loader = jdk.internal.loader.ClassLoaders$AppClassLoader@");
});
// (1) Try to execute the archive with -Djava.system.class.loader=no.such.Klass,
// it should fail
@ -79,8 +81,8 @@ public class SpecifySysLoaderProp {
"TestClassLoader.called = true", //<-but this proves that TestClassLoader was indeed called.
"TestClassLoader: loadClass(\"ReportMyLoader\",") //<- this also proves that TestClassLoader was indeed called.
.assertNormalExit(output -> {
output.shouldMatch(".class,load. TestClassLoader source: file:");
output.shouldMatch(".class,load. ReportMyLoader source: file:.*" + jarFileName);
output.shouldMatch(".class,load.*TestClassLoader source: file:");
output.shouldMatch(".class,load.*ReportMyLoader source: file:.*" + jarFileName);
output.shouldContain("full module graph: disabled due to incompatible property: java.system.class.loader=");
});
@ -91,9 +93,11 @@ public class SpecifySysLoaderProp {
"-verbose:class",
"-cp", appJar,
"TrySwitchMyLoader")
.assertNormalExit("[class,load] ReportMyLoader source: shared objects file",
"TrySwitchMyLoader's loader = jdk.internal.loader.ClassLoaders$AppClassLoader@",
"ReportMyLoader's loader = jdk.internal.loader.ClassLoaders$AppClassLoader@",
"TestClassLoader.called = false");
.assertNormalExit(output -> {
output.shouldMatch(".class,load.*ReportMyLoader source: shared objects file");
output.shouldContain("TrySwitchMyLoader's loader = jdk.internal.loader.ClassLoaders$AppClassLoader@");
output.shouldContain("ReportMyLoader's loader = jdk.internal.loader.ClassLoaders$AppClassLoader@");
output.shouldContain("TestClassLoader.called = false");
});
}
}