JDK 14 RFR (XXS) of JDK-8235499: Change HotSpot jtreg records test to better handle JDK updates
Harold Seigel
harold.seigel at oracle.com
Fri Dec 6 19:10:08 UTC 2019
Hi Joe,
Many of the Records tests will fail when the class file version is
switched from 58 to 59. This is because the JVM requires that Record
classes have version 58.65535.
Perhaps, once the 15 repo is open I can change the JVM to temporarily
allow Records to have either version 58.65535 or 59.65535. Then, once
the class file major version is changed to 59, I can update the tests
and disallow version 58.65535 for records.
Harold
On 12/6/2019 1:48 PM, Joe Darcy wrote:
> Hello,
>
> Several of the HotSpot tests for records need small changes to more
> gracefully handle JDK updates, such as JDK 14 -> 15 coming up soon!
>
> http://cr.openjdk.java.net/~darcy/8235499.0/
>
> Patch below.
>
> (Some updates will be need to make all the tests in this directory
> pass on 15, but these small updates are valid independently.)
>
> Thanks,
>
> -Joe
>
> --- old/test/hotspot/jtreg/runtime/records/ignoreRecordAttribute.java
> 2019-12-06 10:44:14.592741024 -0800
> +++ new/test/hotspot/jtreg/runtime/records/ignoreRecordAttribute.java
> 2019-12-06 10:44:14.264741024 -0800
> @@ -35,7 +35,7 @@
> public class ignoreRecordAttribute {
>
> public static void main(String[] args) throws Exception {
> -
> + String MAJOR_VERSION = Integer.toString(44 +
> Runtime.version().feature());
> ProcessBuilder pb =
> ProcessTools.createJavaProcessBuilder("--enable-preview",
> "-Xlog:class+record", "-Xshare:off", "superNotJLRecord");
> OutputAnalyzer output = new OutputAnalyzer(pb.start());
> @@ -46,7 +46,7 @@
> "-Xlog:class+record", "-Xshare:off",
> "recordIgnoredVersion");
> output = new OutputAnalyzer(pb.start());
> output.shouldContain("Ignoring Record attribute");
> - output.shouldContain("because class file version is not
> 58.65535");
> + output.shouldContain("because class file version is not " +
> MAJOR_VERSION + ".65535");
> }
>
> }
> --- old/test/hotspot/jtreg/runtime/records/recordReflectionTest.java
> 2019-12-06 10:44:15.276741024 -0800
> +++ new/test/hotspot/jtreg/runtime/records/recordReflectionTest.java
> 2019-12-06 10:44:15.036741024 -0800
> @@ -23,7 +23,7 @@
>
> /*
> * @test
> - * @compile --enable-preview --source 14 recordReflectionTest.java
> + * @compile --enable-preview --source ${jdk.version}
> recordReflectionTest.java
> * @run main/othervm --enable-preview recordReflectionTest
> */
>
>
More information about the hotspot-dev
mailing list