JDK-8358158 : test/jdk/java/io/Console/CharsetTest.java failing with NoClassDefFoundError: jtreg/SkippedException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 25
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-05-30
  • Updated: 2025-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Causes :  
Description
Error: Unable to initialize main class CharsetTest
Caused by: java.lang.NoClassDefFoundError: jtreg/SkippedException
];
 stderr: [expect: spawn id exp3 not open
    while executing
"expect eof"
    (file "<dir>/src.full/open/test/jdk/java/io/Console/script.exp" line 32)
]
 exitValue = 1

java.lang.RuntimeException: Test failed. Exit value from 'expect' command: 1
	at CharsetTest.main(CharsetTest.java:69)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
	at java.base/java.lang.Thread.run(Thread.java:1447)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test
Comments
If I read the .jtr correctly, the test gets pass the exists check for /bin/expect and launches "expect". Is the child VM (launched by expect) launched with no args or with args? Asking because it looks like the exception is coming from the child VM whereas I think the test is setup to throw SkipException in the parent VM before it launches "expect".
02-06-2025

Hello Naoto, > - If it is not built, the compilation of the test should fail, but the error happens at the runtime This issue relates to how and where the jtreg compiles these library classes to. It's this jtreg bug https://bugs.openjdk.org/browse/CODETOOLS-7902847. During compilation (for the test), jtreg in some situations ends up using a different output directory for compiling the library classes and for the later action (main/juni/testng), it ends up using a different location for the runtime classpath and that then causes these missing library classes. A (very) lengthier explanation of this similar issue is here https://github.com/openjdk/jdk/pull/20373#discussion_r1706894821.
02-06-2025

[~jpai], that was my first guess, but not sure that is the cause of the issue :- - If it is not built, the compilation of the test should fail, but the error happens at the runtime - In our CI system, the error only happens at linux-x64 tier 7 task with `--enable-preview` java option. Tier2 runs never fail - I ran mach5 tier7 run, but could not reproduce it. Anyway, the fix to `CharsetTest` was not relevant to the original bug fix, so I am thinking of reverting it to not use SkippedException for now as it is the noise for the CI sysetm.
01-06-2025

We are seeing the same issue (macOS/Linux).
01-06-2025

I suspect this test might minimally require: @build jtreg.SkippedException There are a couple of other test library classes used in this test, so those might have to be added too, just to prevent this issue with those classes.
31-05-2025

Regression by the fix to JDK-8356985
30-05-2025