On Thu, 30 Jun 2022 18:39:48 GMT, Xue-Lei Andrew Fan <[email protected]> wrote:
>> test/lib/jdk/test/lib/util/ForceGC.java line 58:
>>
>>> 56: Reference.reachabilityFence(ref);
>>> 57:
>>> 58: for (int retries = (int)(timeout / 200); retries >= 0;
>>> retries--) {
>>
>> The logic around the timeout might be clearer if it was only based on the
>> number of retries,
>> and can be scaled by the TIMEOUT_FACTOR too.
>
> I just curious if the factor could be set to some unusual values like "1.25".
> Scaling on timeout, and then calculating the retires could be more accuracy
> for such circumstances, although it may be not necessary. I moved the
> retries calculation close to the for-loop. Hope it is better for readers.
Yes, `Utils.adjustTimeout(long x)` uses floating point and then converts back.
-------------
PR: https://git.openjdk.org/jdk/pull/8979