RFR: JDK-8304557: java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java times out [v2]

Viktor Klang duke at openjdk.org
Thu Mar 23 11:43:35 UTC 2023


On Thu, 23 Mar 2023 10:35:15 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> @pavelrappo I agree with that. I have the same experience. With that said, I have implemented a whitebox test which reaches in an monitors the task queue of the Delayer. @AlanBateman & @jaikiran any preference here?
>
> Hello Viktor, when you say whitebox test, do you mean adding:
> 
> 
> @modules java.base/java.util.concurrent:open
> 
> to the jtreg test definition and then using reflection within the test case to assert on the internals?
> 
> The original bug which introduced this test was about the `CompletableFuture` implementation unnecessarily holding on to an internal `Future` even after its use was done. So in order to test the fix effectively, if it means adding a `:open` to the module's package, solely in this test, then I think it's OK. I see there are existing test cases which have similar usages.

@jaikiran Yes, see the new commit I pushed which illustrates the whitebox solution (which will also run dramatically faster than the old one) which relies on the implementation detail on how the timeouts are scheduled.

@AlanBateman @pavelrappo Does the new approach seem acceptable? 🤔

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13116#discussion_r1146054535


More information about the core-libs-dev mailing list