RFR: 8292051: jdk/internal/misc/TerminatingThreadLocal/TestTerminatingThreadLocal.java failed "AssertionError: Expected terminated values: [666] but got: []"

Peter Levart plevart at openjdk.org
Fri Aug 12 13:52:56 UTC 2022


On Wed, 10 Aug 2022 09:18:01 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> Change the test to use a custom scheduler so there is better control on when the carrier threads terminates. Also convert test to TestNG so that all test cases can be run in the context of a virtual thread.

Now that we have control over termination of carrier thread which can be stopped at will without waiting for 30s or more, we can again test all cases even with virtual threads...

test/jdk/jdk/internal/misc/TerminatingThreadLocal/TestTerminatingThreadLocal.java line 145:

> 143:         // wait for carrier to terminate
> 144:         Thread carrier = carrierRef.get();
> 145:         carrier.join();

...would `close()`-ing the `pool` already guarantee that all pool thread(s) are already stopped? `join()` would not be needed then. But the spec. only talks about tasks that finish execution, not about threads...

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

Changes requested by plevart (Reviewer).

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


More information about the core-libs-dev mailing list