RFR: 8310331: JitTester: Exclude java.lang.Math.random

Tobias Hartmann thartmann at openjdk.org
Mon Jul 3 05:23:05 UTC 2023


On Sun, 2 Jul 2023 09:16:55 GMT, Daohan Qu <dqu at openjdk.org> wrote:

> Test cases generated by JitTester might contain calls to `java.lang.Math.random()`. We could not set a seed for this random call. (In its implementation, `java.lang.Math` create `java.util.Random` instance statically (using the constructor `Random()`) and there is no way to set a seed for it.)
> 
> Such tests might show up different variable values/printouts on each execution (Please refer to [the issue description](https://bugs.openjdk.org/browse/JDK-8310331)).
> 
> Since it is meaningless to generate test cases with "unreproducible" results and JitTester has been able to assign random values to the generated variables (this seed could be set). Maybe we could just exclude the use of `java.lang.Math.random()` in JitTester's test case generation.

Looks good to me.

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

Marked as reviewed by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14748#pullrequestreview-1510394923


More information about the hotspot-compiler-dev mailing list