RFR: 8254042: gtest/GTestWrapper.java failed os.test_random

Coleen Phillimore coleenp at openjdk.java.net
Wed Nov 25 02:20:56 UTC 2020


On Wed, 25 Nov 2020 01:13:14 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> The function os::init_random() and os::random() both set the _rand_seed. This test thinks nothing can change the seed while it is computing its expected value.
>> I changed the test to run in a VM operation safepoint.  Alternately, I can change the test to not verify the random value computed in the loop, or remove the test.
>> Ran tier1 tests on linux-x64 and windows-x64.
>
> If the problem is as suspected then the change to execute the test at a safepoint seems reasonable. Kim had doubts that any other thread should be running in a TEST case (versus TEST_VM case).
> The changes to the seed initialization seem unnecessary (in relation to the bug fix) but also harmless. Like all our VM initialization it is safe to do init_random() during VM initialization, so there should not have been any issue in that regard. But as all platforms set the same seed anyway, this is simpler.
> Thanks,
> David

Thanks for reviewing this, David.  I experimented with a ShouldNotReachHere and found there were other vm threads running even though the test was TEST().  Unfortunately, this didn't reproduce enough to be able to experiment which os::random() made the test fail.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1422


More information about the hotspot-dev mailing list