RFR: 8282404: DrawStringWithInfiniteXform.java failed with "RuntimeException: drawString with InfiniteXform transform takes long time" [v2]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Nov 17 03:20:20 UTC 2022
On Wed, 16 Nov 2022 17:04:08 GMT, Phil Race <prr at openjdk.org> wrote:
>> test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java line 90:
>>
>>> 88: timer.cancel();
>>> 89: }
>>> 90: System.out.println("Test passed");
>>
>> It seems timer.cancel() says "Terminates this timer, discarding any currently scheduled tasks." so it might disregard the "done" check been done in ScheduleTask resulting in false positive...
>> Should we do Thread.yield() instead?
>>
>> Also, this test has many coding violations like l70, l79 where no space between operators,variables...
>
>> It seems timer.cancel() says "Terminates this timer, discarding any currently scheduled tasks."
>
> Yes, that's the intention.
>
>> so it might disregard the "done" check been done in ScheduleTask resulting in false positive...
>
> If we reach timer.cancel() before the timer fires off the task we don't need the task
> canceling it means the test can exit immediately - not wait 20 or 30 seconds.
>
> If it does fire because cancel is too slow, it will see "done==true"
>
> So perhaps I'm not following your point ?
>
>
>> Should we do Thread.yield() instead?
>
> No.
>
>> I'll tidy it up a bit more.
OK. So, it means ScheduleTask should ideally never be executed if drawString with infinite transform takes lesser time < 30s, which is desirable and test can exit.
-------------
PR: https://git.openjdk.org/jdk/pull/11179
More information about the client-libs-dev
mailing list