RFR: 8254350: CompletableFuture.get may swallow InterruptedException [v2]

Alan Bateman alanb at openjdk.java.net
Tue Dec 8 10:38:16 UTC 2020


On Tue, 8 Dec 2020 10:19:22 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Martin Buchholz has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
>
> 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.

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

PR: https://git.openjdk.java.net/jdk/pull/1651


More information about the core-libs-dev mailing list