RFR: 8310331: JitTester: Exclude java.lang.Math.random
Daohan Qu
dqu at openjdk.org
Sun Jul 2 09:40:54 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.
It seems to be a leftover from [JDK-8239500: jittester shouldn't use non-deterministic System methods](https://bugs.openjdk.org/browse/JDK-8239500).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14748#issuecomment-1616534623
More information about the hotspot-compiler-dev
mailing list