On Tue, 25 Feb 2025 17:06:31 GMT, Viktor Klang <vkl...@openjdk.org> wrote:

>> Doug Lea has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Standardize parameter checking
>
> test/jdk/java/util/concurrent/tck/ForkJoinPool20Test.java line 577:
> 
>> 575:                 Thread.sleep(LONGER_DELAY_MS); return Boolean.TRUE; }};
>> 576:         ForkJoinTask<?> task = p.submitWithTimeout(c, 1, NANOSECONDS, 
>> null);
>> 577:         Thread.sleep(timeoutMillis());
> 
> Do we need to sleep here or just get the result with a timeout expecting a 
> CancellationException then asserting isCancelled == true?

This checks: The task is not run and will eventually show up as cancelled. So 
as is done in other juc-tck test, we sleep a little for the "eventually" part. 
This and many similar cases can rarely misfire, in which case timeoutMillis is 
increased as a check by harness.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23702#discussion_r1970618201

Reply via email to