JDK-8296554 : MouseLocationOnScreenTest sometime fails when system is busy
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx20
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-11-08
  • Updated: 2023-07-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
I very occasionally get a failure while running MouseLocationOnScreenTest on Windows. Here is one such failure:

MouseLocationOnScreenTest > testMouseLocation FAILED
    java.lang.AssertionError: expected:<1227> but was:<1226>
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.failNotEquals(Assert.java:835)
        at org.junit.Assert.assertEquals(Assert.java:647)
        at org.junit.Assert.assertEquals(Assert.java:633)
        at test.robot.javafx.scene.MouseLocationOnScreenTest.validate(MouseLocationOnScreenTest.java:131)
        at test.robot.javafx.scene.MouseLocationOnScreenTest.cross(MouseLocationOnScreenTest.java:159)
        at test.robot.javafx.scene.MouseLocationOnScreenTest.lambda$testMouseLocation$10(MouseLocationOnScreenTest.java:117)

My system was somewhat busy running other processes at the time. After rerunning this several times with an idle system, it doesn't fail. The fix for JDK-8213573 added a small delay to workaround the limitation inherent in this test. If the system is too heavily loaded, it can still fail occasionally.
Comments
Unless we start seeing this more that just occasionally on a busy dev system, we are unlikely to do anything about this.
08-11-2022