RFR: 8254350: CompletableFuture.get may swallow InterruptedException [v2]
Daniel Fuchs
dfuchs at openjdk.java.net
Tue Dec 8 11:54:16 UTC 2020
On Tue, 8 Dec 2020 10:35:20 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> test/jdk/java/util/concurrent/CompletableFuture/LostInterrupt.java line 49:
>>
>>> 47:
>>> 48: public static void main(String[] args) throws Exception {
>>> 49: ThreadLocalRandom rnd = ThreadLocalRandom.current();
>>
>> Hi Martin,
>>
>> Is using a `ThreadLocalRandom` important for the test logic?
>> I was wondering whether it would be better to use ( `* @library /test/lib`) `jdk.test.lib.RandomFactory`,
>> which prints the random seed in the output so that you can reproduce with the same pseudo-random
>> sequence in case of test failures.
>>
>> best regards,
>>
>> -- daniel
>
> RandomFactory is probably overkill here as the test just needs to exercise untimed and timed get. So just a random boolean rather than a wide range of random values.
OK.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1651
More information about the core-libs-dev
mailing list