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

Ioi Lam iklam at openjdk.org
Fri Jan 6 19:23:51 UTC 2023


On Fri, 6 Jan 2023 14:25:05 GMT, Ashutosh Mehra <duke 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>

Tests passed.

I think this qualifies as a Trivial change so only one reviewer is needed.

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

Marked as reviewed by iklam (Reviewer).

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


More information about the hotspot-runtime-dev mailing list