On Tue, 6 Jun 2023 00:02:47 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

> The test fails with the virtual test thread factory because it tries to find 
> the "main" thread in the list of threads returned by JDI, but "main" is a 
> virtual thread and will only be returned by JDI if the debug agent is 
> launched with includevirtualthreads=y. As a result the thread is not found 
> and the test asserts:
> 
> java.lang.RuntimeException: assertTrue: expected true, was false
>       at jdk.test.lib.Asserts.fail(Asserts.java:594)
>       at jdk.test.lib.Asserts.assertTrue(Asserts.java:486)
>       at jdk.test.lib.Asserts.assertTrue(Asserts.java:472)
>       at TestNestmateAttr.checkGoodTransforms(TestNestmateAttr.java:511)
>       at TestNestmateAttr.methodEntered(TestNestmateAttr.java:320)
>       at TestScaffold$EventHandler.notifyEvent(TestScaffold.java:205)
>       at TestScaffold$EventHandler.run(TestScaffold.java:279)
>       at java.base/java.lang.Thread.run(Thread.java:1583)
> 
> The fix is to always run the debug agent with includevirtualthreads=y.
> 
> Tested by running all com/sun/jdi tests locally with and without the virtual 
> test thread factory. Also ran tier1 and tier5 svc test tasks.

This pull request has now been integrated.

Changeset: a54f4d4a
Author:    Chris Plummer <cjplum...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/a54f4d4ab9537ac7e070dd82e26f73c90d82290a
Stats:     7 lines in 2 files changed: 3 ins; 2 del; 2 mod

8309509: com/sun/jdi/RedefineNestmateAttr/TestNestmateAttr.java fails with 
virtual test thread factory

Reviewed-by: sspitsyn, amenkov

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

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

Reply via email to