This issues exists to fix the HotSpot tests that do not use jdk.test.lib.Utils.getRandomInstance().
> ag 'new Random\(\)' open/test/hotspot/jtreg --java
open/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java:98: Random r = new Random();
open/test/hotspot/jtreg/runtime/Metaspace/elastic/AllocationProfile.java:47: Random r = new Random();
open/test/hotspot/jtreg/compiler/conversions/TestMoveConvI2LOrCastIIThruAddIs.java:160: Random rnd = new Random();
open/test/hotspot/jtreg/compiler/vectorapi/TestVectorMaskTrueCount.java:49: private static final Random RD = new Random();
It might be worth thinking about some mechanism for preventing new usages of "new Random()". A simple job that runs the above `ag` command would probably be sufficient.
> ag 'new Random\(\)' open/test/hotspot/jtreg --java
open/test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java:98: Random r = new Random();
open/test/hotspot/jtreg/runtime/Metaspace/elastic/AllocationProfile.java:47: Random r = new Random();
open/test/hotspot/jtreg/compiler/conversions/TestMoveConvI2LOrCastIIThruAddIs.java:160: Random rnd = new Random();
open/test/hotspot/jtreg/compiler/vectorapi/TestVectorMaskTrueCount.java:49: private static final Random RD = new Random();
It might be worth thinking about some mechanism for preventing new usages of "new Random()". A simple job that runs the above `ag` command would probably be sufficient.
- relates to
-
JDK-8241623 use reproducible random in hotspot tests
- Resolved