RFR: 8296554: MouseLocationOnScreenTest sometime fails when system is busy

Kevin Rushforth kcr at openjdk.org
Fri Apr 11 18:19:30 UTC 2025


On Fri, 11 Apr 2025 14:49:06 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> There was a Assertion fail issue in mouse location test case JDK-8296554,
>> Reason: We felt the one mili second delay time for the Robot test may be insufficient in few OS.
>> Solution: We Changed the delay time to three mili second.
>> 
>> Verification:
>> Tested in Windows 11, and the Assert fail issue is not found.
>
> tests/system/src/test/java/test/robot/javafx/scene/MouseLocationOnScreenTest.java line 46:
> 
>> 44:     static CountDownLatch startupLatch = new CountDownLatch(1);
>> 45:     static Robot robot;
>> 46:     private static int DELAY_TIME = 3;
> 
> minor: `Util.sleep()` could be moved to `validate()`
> 
> question: even though the value is 3x the original, should it be longer to account for any hiccups?  maybe 10?  what do you think?

If we go with this solution, I would recommend leaving it at 3ms. It fails very, very rarely with the existing 1ms, so 3x the time ought to be enough. Tripling it again would just make the test take that much longer without any real assurance that it is needed.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1772#discussion_r2040075325


More information about the openjfx-dev mailing list