RFR: 8262060: compiler/whitebox/BlockingCompilation.java timed out

Igor Ignatyev iignatyev at openjdk.java.net
Fri Mar 26 20:39:24 UTC 2021


On Fri, 26 Mar 2021 20:22:14 GMT, Evgeny Nikitin <enikitin at openjdk.org> wrote:

> Please review this small fix for a test.
> 
> Test fails sometimes when run with UsageTracker enabled. For some reason, a loading of ThreadLocalRandom can happen during the test run, and this invalidates Random.nextInt method (because it's not the only implementation now).
> 
> Fixed by pre-loading ThreadLocalRandom. Tested by multiple runs with UsageTracker enabled - approx. 1 out of 20-30 test runs fails without the fix and no failures spotted with the fix.

Hi Evgeny,

there is no reason for this test to depend on `Random` and hence be dependent on the hierarchy of its subclasses (which I assume is the reason the test fails). so I'd rather fix it by removing the dependency on `Random`, `BlockingCompilation::foo` can return a constant or do some convoluted math/logic computation "locally" if we are afraid that some optimizations can affect the test's behavior.

Cheers,
-- Igor

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

Changes requested by iignatyev (Reviewer).

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


More information about the hotspot-compiler-dev mailing list