RFR: 8350151: Support requires property to filter tests incompatible with --enable-preview [v2]

Roger Riggs rriggs at openjdk.org
Thu Feb 20 15:16:56 UTC 2025


On Wed, 19 Feb 2025 20:32:56 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> It ran ok for me, once I got the command line flags correct.
>> It ran ok if I added `@enablePreview`.
>> 
>> It also ran ok with an explicit @run command:  (it does not currently have an @run command).
>> 
>>  * @run main/othervm --enable-preview SecurityManagerWarnings
>>  ```
>
> For me it fails with
> ----------System.err:(18/917)----------
>  stdout: [];
>  stderr: [Error: Unable to initialize main class SecurityManagerWarnings
> Caused by: java.lang.NoClassDefFoundError: jdk/test/lib/process/OutputAnalyzer
> ]
>  exitValue = 1
> that seems pretty strange, might be test library issue?

I haven't been able to reproduce that locally. Even with mis-matched compilation of the test library and test code.

I noticed the NoClassDefFoundError message comes from the child process. 
The child is invoked with test.noclasspath=true and no path to the test library.  (intentionally)
The SecurityManagerWarning class explicitly refers to OutputAnalyzer.
There might be a path in which the new VM tries to load the OutputAnalyzer (and throw an error)

Finding a way to reproduce locally might be necessary to track down the cause.
Perhaps adding -Xlog (for the child) might provider more information about the sequence of events.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23653#discussion_r1963767231


More information about the compiler-dev mailing list