Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8289605

Robot capture tests fail intermittently on Mac M1

    XMLWordPrintable

Details

    Description

      When running the full test suite, including robot tests on an M1 MacBook Pro, we get a few failures in screen capture test. It looks like the failures are caused by the cursor being in the area that is being read using the robot screen capture APIs (suggesting that the cursor is captured, which seems odd).

      The following tests fail:

      RobotTest > testScreenCapture FAILED
      RegionBackgroundImageUITest > alignedImage_RoundSpace FAILED
      RegionBackgroundImageUITest > unalignedImage_PositionCenterBottom FAILED
      RegionBackgroundImageUITest > alignedImage_PositionBottomRightRepeatX FAILED
      RegionBackgroundImageUITest > unalignedImage_PositionCenterTop FAILED
      RegionBackgroundImageUITest > alignedImage FAILED
      RegionBackgroundImageUITest > unalignedImage_RepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterLeftRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterRightRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_RepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterFiftyPercentRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterRepeatX FAILED
      RegionBackgroundImageUITest > unalignedImage_PositionCenterTopRepeatX FAILED
      RegionBackgroundImageUITest > unalignedImage_PositionCenterLeftRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterFiftyPercent FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenter FAILED
      RegionBackgroundImageUITest > unalignedImage_PositionCenterBottomRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_Round FAILED
      RegionBackgroundImageUITest > alignedImage_Space FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterTopRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterTopRepeatY FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterBottom FAILED
      RegionBackgroundImageUITest > unalignedImage_PositionBottomRightRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterBottomRepeatX FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterBottomRepeatY FAILED
      RegionBackgroundImageUITest > alignedImage_PositionCenterTop FAILED


      If I run just the RegionBackgroundImageUITest it passes. If I manually move the mouse out of the way after running a test that laves the cursor in the "wrong" place before the RegionBackgroundImageUITest run, then it passes.

      That isn't possible for RobotTest, since other tests in the same class move the mouse.

      The proposed fix is to call mouseMove(0, 0) in an `@Before` method of all tests that do screen capture. Further, the RobotTest should create it's initial Stage with a Scene so that it doesn't end up at (0,0) which can cause other problems.

      Attachments

        Issue Links

          Activity

            People

              angorya Andy Goryachev
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: