use reproducible random in HotSpot tests

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 22
    • Component/s: 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.

            Assignee:
            Ramkumar Sunderbabu
            Reporter:
            Douglas Simon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: