Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8317124

use reproducible random in HotSpot tests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot
    • None

      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.

            rsunderbabu Ramkumar Sunderbabu
            dnsimon Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: