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

Calvin Cheung ccheung at openjdk.org
Fri Jan 6 19:23:52 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>

Marked as reviewed by ccheung (Reviewer).

I tested your patch by running the `open/test/hotspot/jtreg:hotspot_appcds_dynamic` test group with `-Dtest.dynamic.cds.archive=true` locally on linux-x64 and all 93 tests passed.

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

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


More information about the hotspot-runtime-dev mailing list