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

Chris Plummer cjplummer at openjdk.org
Tue Jun 6 18:20:11 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.

This pull request has now been integrated.

Changeset: 571fbdc3
Author:    Chris Plummer <cjplummer at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/571fbdc3110440ec3a36bb6005dc5a0358696df5
Stats:     16 lines in 2 files changed: 10 ins; 2 del; 4 mod

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

Reviewed-by: amenkov, sspitsyn

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

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


More information about the serviceability-dev mailing list