RFR: 8299699: Test runtime/cds/appcds/WrongClasspath.java fails after JDK-8299329

Ashutosh Mehra duke at openjdk.org
Fri Jan 6 19:29:50 UTC 2023


On Fri, 6 Jan 2023 18:55:31 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Failure happens because `TestCommon#patchJarForDynamicDump(String cp)` expects the jar files passed in `cp` parameter are with absolute path. The new test case added for JDK 8299329 passed jar files using path relative to work dir.
>> 
>> 
>>         if (!firstJar.startsWith(expected)) {
>>             throw new RuntimeException("FIXME: jar file not at a supported location ('"
>>                                        + expected + "'): " + firstJar);
>>         }
>> 
>> 
>> This fix converts `firstJar` into real path using `Path.toRealPath()` before doing `firstJar.startsWith(expected)`.
>> This way all relative paths are also converted to absolute paths before the check is performed.
>> 
>> I tested this fix by running WrongClasspath test with `-Dtest.dynamic.cds.archive=true` as:
>> 
>> $ java -jar /work/jtreg/build/images/jtreg/lib/jtreg.jar -Dtest.dynamic.cds.archive=true -jdk:/work/jdk/build/JDK-8299329-fd/images/jdk test/hotspot/jtreg/runtime/cds/appcds/WrongClasspath.java
>> 
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>
> Looks good to me. I have tested locally and the test passed. I'm now running the related test tasks in our CI to make sure the patch works with the other tests as well.

@iklam @calvinccheung thanks for testing the patch.

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

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


More information about the hotspot-runtime-dev mailing list