RFR(S/M) : 8242310 : use reproducible random in hotspot compiler tests
Igor Ignatyev
igor.ignatyev at oracle.com
Wed Apr 8 14:47:15 UTC 2020
> On Apr 7, 2020, at 11:17 PM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:
>
> Hi Igor,
>
> On 08.04.20 03:04, Igor Ignatyev wrote:
>> - replaces fixed seed w/ 42 (in the tests which don't really depend on a seed value) as it's most common fixed seed in hotspot test suite;
>
> What's the reason to use a fixed seed in the first place? Seems to me that even if the test does not
> directly use the random value, it doesn't hurt to use a non-fixed seed. In fact, wouldn't using a
> non-fixed seed increase coverage? Even if the value is not checked, it's still propagated through
> registers, stack and heap space and might therefore make a difference.
the thing is randomness (even reproducible) in tests comes w/ a price -- you had to be more careful when use such tests to verify fixes, compare results across different runs, etc. so in some cases, the possible gain in code coverage doesn't justify the drawbacks, and frankly I'm not a big fun of using something just b/c it might increase coverage in areas unrelated to the original goals of a test. I had to admit thought that I had several internal discussions w/ myself, at first I removed almost all fixed seed values, then I was going back and forth weighing pros and cons; at the end I decided to leave it as-is for now and reevaluate later on a test-by-test basis.
>
>> http://cr.openjdk.java.net/~iignatyev//8242310/webrev.00
>
> Looks good.
>
> Best regards,
> Tobias
More information about the hotspot-compiler-dev
mailing list