On Thu, 16 Mar 2023 13:37:10 GMT, Viktor Klang <d...@openjdk.org> wrote:

> Addresses the situation where exceptional completion of `orTimeout`:ed 
> CompletableFutures wouldn't cancel the timeout task which could lead to 
> memory leaks if done frequently enough with long enough timeout durations.
> 
> Fix discussed with @DougLea

test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java
 line 45:

> 43:         var startTime = System.currentTimeMillis();
> 44:         var testRunTime = Duration.ofSeconds(10).toMillis();
> 45:         while((System.currentTimeMillis() - startTime) < testRunTime) {

Suggestion:

        while ((System.currentTimeMillis() - startTime) < testRunTime) {

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

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

Reply via email to