Running `JLinkToolProviderTest` on a JDK built with `--enable-linkable-runtime` 
fails with the following error:

java.lang.AssertionError: 1:Error: jlink does not support linking from the 
run-time image when running on a patched runtime with --patch-module:
at JLinkToolProviderTest.checkConcurrentAccess(JLinkToolProviderTest.java:69)
at JLinkToolProviderTest.main(JLinkToolProviderTest.java:78)
...

The test invokes `jlink` through `ToolProvider`. Its default agent-VM execution 
runs on a patched runtime, which `jlink` does not support when linking from the 
run-time image.

The proposed fix changes the test’s jtreg action from `main` to `main/othervm`, 
so the `ToolProvider` invocation runs in a fresh, unpatched VM.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - 8391170: JLinkToolProviderTest fails after JDK-8390505 when using configure 
--enable-linkable-runtime

Changes: https://git.openjdk.org/jdk/pull/32531/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32531&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8391170
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/32531.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32531/head:pull/32531

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

Reply via email to