RFR: 7904149: jtreg fails when test with @enablePreview is executed with driver mode [v2]

Christian Stein cstein at openjdk.org
Fri Feb 20 08:22:06 UTC 2026


On Fri, 20 Feb 2026 01:49:16 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

>> The test like this
>> 
>> 
>> 
>> /*
>>  * @test
>>  * @enablePreview
>>  * @run driver ${test.main.class}
>>  */
>> 
>> 
>> 
>> public class PreviewDriverTest {
>>     Integer i;
>>     public static void main(String[] args) throws Exception {
>>     }
>> }
>> 
>> 
>> fails in valhalla repo because class is compiled with enable-preview while executed without this option.
>> 
>> Test fails with:
>> java.lang.UnsupportedClassVersionError: Preview features are not enabled for PreviewDriverTest (class file version 71.65535). Try running with '--enable-preview'
>> 
>> It doesn't use any Valhalla feature directly but has a field Integer and javac generates additional attributes because of this.
>> 
>> Fix is just to pass --enable-preview to driver code.
>> The workaround is to don't run driver tests with enable preview.
>
> Leonid Mesnik has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - added faq
>  - tag-spec updated

Thanks for updating the spec and faq documents.

Please also update the dates in the copyright headers and increase the version of the spec (as suggested).

src/share/classes/com/sun/javatest/regtest/exec/DriverAction.java line 2:

> 1: /*
> 2:  * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.

Suggestion:

 * Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved.

src/share/doc/javatest/regtest/tag-spec.html line 3:

> 1: <!DOCTYPE HTML>
> 2: <!--
> 3:  Copyright (c) 2006, 2025, Oracle and/or its affiliates. All rights reserved.

Suggestion:

 Copyright (c) 2006, 2026, Oracle and/or its affiliates. All rights reserved.

src/share/doc/javatest/regtest/tag-spec.html line 55:

> 53: <a href="mailto:jtreg-use at openjdk.org">jtreg-use at openjdk.org</a>.
> 54: <br>
> 55: 1.47, 7 July, 2020

Suggestion:

1.48, 20 February, 2026

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

Changes requested by cstein (Reviewer).

PR Review: https://git.openjdk.org/jtreg/pull/314#pullrequestreview-3830642328
PR Review Comment: https://git.openjdk.org/jtreg/pull/314#discussion_r2831967834
PR Review Comment: https://git.openjdk.org/jtreg/pull/314#discussion_r2831972290
PR Review Comment: https://git.openjdk.org/jtreg/pull/314#discussion_r2831975431


More information about the jtreg-dev mailing list