On Tue, 13 Oct 2026 14:06:52 GMT, Jaikiran Pai <[email protected]> wrote:

> Can I please get a review of this test-only change which addresses the 
> failure reported in https://bugs.openjdk.org/browse/JDK-8394341?
> 
> This test launches processes as part of its test execution. It was recently 
> refactored to use the commonly used JDK internal 
> `jdk.test.lib.process.ProcessTools` test library. After this refactoring, 
> if/when this test gets launched on a virtual thread (through the 
> `-testThreadFactory:Virtual`), then the `testWithClassPathSetViaProperty()` 
> test method fails because it launches a `java` processes with a 
> custom/controlled classpath.
> 
> Given the way `ProcessTools` library is implemented, when launching a `java` 
> process in the presence of `-testThreadFactory:Virtual`, the launched process 
> is expected to contain the `jdk.test.lib.process.ProcessTools` class in its 
> classpath. Given that `testWithClassPathSetViaProperty()`, configures a 
> classpath of its own, the test thus fails due to the missing 
> `jdk.test.lib.process.ProcessTools`.
> 
> In practice, this test shouldn't be run when launching jtreg with 
> `-testThreadFactory:Virtual`, neither should the child processes be passed 
> any additional arguments than what the test method itself configures. The 
> commit in this PR sets up the relevant `@requires` in the test definition to 
> prevent such executions. The test methods themselves has been updated to use 
> `ProcessTools.executeCommand(...)` to make it clear that the child processes' 
> arguments shouldn't be affected by how jtreg is launched (for example, by 
> passing `-javaoptions:...`)
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

I'm looking for a review of this test-only change please. I've verified in our 
CI that this test now gets skipped when launched through a virtual thread and 
passes as expected when launched with a platform thread.

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

PR Comment: https://git.openjdk.org/jdk/pull/33345#issuecomment-6211255394

Reply via email to