RFR: 8309506: com/sun/jdi/MultiBreakpointsTest.java fails with virtual test thread factory

Serguei Spitsyn sspitsyn at openjdk.org
Tue Jun 6 06:11:53 UTC 2023


On Mon, 5 Jun 2023 22:13:29 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> The test fails when the main debuggee thread is a virtual thread, because virtual threads are always daemon threads. Because of this all the test threads that the debuggee creates are also daemon threads. The main deuggee thread immediately exits after creating the test threads, and at that point there are no non-daemon threads left running to keep the debuggee process alive, so the test threads never get a chance to do all the work that is expected of them. 
> 
> The fix is to use Thread.join() to prevent the main test thread from exiting until all the created tests threads have exited. I also updated the test so when run using the virtual test thread factory, the debuggee test threads will now be virtual threads. Previously just the main debuggee thread would be a virtual thread. This is not a bug fix, but does provide better virtual thread testing.

Looks good.
Thanks,
Serguei

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

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14323#pullrequestreview-1464335395


More information about the serviceability-dev mailing list