On Mon, 10 Mar 2025 23:05:10 GMT, Volodymyr Paprotski <vpaprot...@openjdk.org> wrote:
>> test/jdk/com/sun/security/util/math/intpoly/MontgomeryPolynomialFuzzTest.java >> line 123: >> >>> 121: } >>> 122: >>> 123: if (rnd.nextBoolean()) { >> >> Why is this done randomly? Wouldn't we want to check these situations every >> time? > > I was mostly attempting to test 'random paths' through the code, and this was > a way to pseudo-randomly accomplish that. (i.e. a product of a difference, a > product of a product.. and so on..) > > Since this is looping, we got 50% chance of getting both, without me having > to write/think-through all the many permutations of what input/outputs to > each operations can be. > > (Extend the loop count to run for several hours during development.. and it > does wonders to testing corner cases. Have been following this 'template' in > most my PRs) Randomness isn't idea for reproducibility. If a failure occurs, is it obvious what operations were done? I don't see any stdout or stderr messages to know what operations happen to bring about a possible failure. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23719#discussion_r2004074368