RFR(S) : 8243429 : use reproducible random in :vmTestbase_nsk_stress

David Holmes david.holmes at oracle.com
Fri May 1 02:34:19 UTC 2020


Hi Igor,

On 1/05/2020 3:15 am, Igor Ignatyev wrote:
> http://cr.openjdk.java.net/~iignatyev/8243429/webrev.00
>> 82 lines changed: 41 ins; 4 del; 37 mod;

The patch files in your webrevs are not generating properly due to the 
use of mq. can you fix that?

> Hi all,
> 
> could you please review this small patch?
> from JBS:
>> this subtask is to use j.t.l.Utils.getRandomInstance() as a random number generator, where applicable, in :vmTestbase_nsk_stress test group and marking the tests which make use of "randomness" with a proper k/w.

I'm a bit confused about the strategy here:

vmTestbase/nsk/stress/except/except012.java

-            Random random = new Random(0);
+            Random random = new Random(42);

but:

vmTestbase/nsk/stress/jni/jnistress002.java

-    static Random myRandom = new Random();
+    Random myRandom = new Random(Utils.getRandomInstance().nextLong());

why are these random instances seeded completely differently?

And looking at:

vmTestbase/nsk/stress/jni/gclocker/gcl001.java

you changed it to use the LocalRandom utility rather than creating its 
own random instance. Why was that applicable here but not in other tests?

The changes from Math.random to a local RNG from getRandomInstance() 
seem okay- but again why that versus LocalRandom? Do we even need 
LocalRandom?

Thanks,
David

> testing: : vmTestbase_nsk_stress test group
> JBS: https://bugs.openjdk.java.net/browse/JDK-8243429
> webrevs:
> - code changes: http://cr.openjdk.java.net/~iignatyev//8243429/webrev.00.code
>> 58 lines changed: 41 ins; 4 del; 13 mod;
> 
> - adding k/w: http://cr.openjdk.java.net/~iignatyev//8243429/webrev.00.kw
>> 11 lines changed: 0 ins; 0 del; 11 mod;
> 
> - full: http://cr.openjdk.java.net/~iignatyev//8243429/webrev.00
>> 82 lines changed: 41 ins; 4 del; 37 mod;
> 
> 
> Thanks,
> -- Igor
> 


More information about the hotspot-dev mailing list