On Thu, 5 Jan 2023 19:25:07 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> This is an enhancement of the test case in 
>> [JDK-8296754](https://bugs.openjdk.org/browse/JDK-8296754), which tests 
>> against an archive created by the "boot JDK", which is usually set as the 
>> previous official JDK release when building the JDK repo.
>> 
>> If it's able to acquire previous valid JDK releases:
>>      - Download and install previous JDK versions (19 through N)
>>         where N == java.lang.Runtime.version​().major() - 1
>>      - Test the interaction of the current JDK versus each of the previous 
>> releases
>> 
>> If it's not able to find the previous releases revert to the existing logic 
>> in TestAutoCreateSharedArchiveUpgrade.java (use the test.boot.jdk or 
>> test.previous.jdk properties). Verified with tier1-4 tests.
>
> test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java
>  line 80:
> 
>> 78: 
>> 79:         // Earliest testable version is 19
>> 80:         int n = java.lang.Runtime.version().major() - 1;
> 
> Can this just do n-1 and not download every release? So if JDK 20 works with 
> JDK 19, then JDK 21 works with JDK 20 and transitively would work with 19?

I think we should start the loop from n-1 and go downwards. After the first 
iteration:


if (System.getProperty("test.autocreatesharedarchive.all.jdk.versions") == 
null) {
  break;
}


This should be enough for day-to-day testing. For thoroughness, we can add a 
task at tier 7 or 8 to specify 
`-Dtest.autocreatesharedarchive.all.jdk.versions` and check against all 
applicable JDK versions.

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

PR: https://git.openjdk.org/jdk/pull/11852

Reply via email to