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

Daohan Qu dqu at openjdk.org
Sun Jul 2 09:25:12 UTC 2023


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.

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

Commit messages:
 - Exclude Math.random() from test case generated by jittester

Changes: https://git.openjdk.org/jdk/pull/14748/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14748&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8310331
  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/14748.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14748/head:pull/14748

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


More information about the hotspot-compiler-dev mailing list