RFR: 8347039: ThreadPerTaskExecutor terminates if cancelled tasks still running

Viktor Klang vklang at openjdk.org
Tue Jan 14 06:55:51 UTC 2025


On Sat, 11 Jan 2025 07:29:32 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> test/jdk/java/util/concurrent/ThreadPerTaskExecutor/ThreadPerTaskExecutorTest.java line 306:
>> 
>>> 304:             stop.await();
>>> 305:             return null;
>>> 306:         });
>> 
>> One (additional?) option would be to obtain a reference to the returned Future from submit and assert that the Future isn't done after shutdown() returns.
>
> Done but I don't want to too far with adding tests for Future methods in these test methods, only because the testAwaitTerminationXXX methods are for awaitTermination.

@AlanBateman That's fair, my suggestion was based on the notion that the task/future itself was changed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23036#discussion_r1911985040


More information about the core-libs-dev mailing list