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

Add canary system test checking if Stage receives focus on show

XMLWordPrintable

    • generic
    • windows

      Windows focus change policy enforced in SetForegroundWindow() API can sometimes prevent system test run from giving focus to JavaFX Stage. A workaround to the problem is using --no-daemon flag in gradle when running tests - then the Gradle server is a foreground process and focus can be passed on to processes it spawns.

      Add a canary system test checking whether a Stage receives focus and upon failure leave a message in test logs informing to try using --no-daemon flag.


      ------ OLD DESCRIPTION ------
      Old title: Resolve system test focus issues

      Some system tests happen to fail because the test stage does not ensure it has focus. Their test stages without focus fail to receive necessary test events or key combos, which causes failures. This mostly happens on my Windows 11 machine and can cause some interesting side-effects:
      - MenuDoubleShortcutTest - almost all cases fail because returned states are IGNORED instead of FIRED*
        - This also sometimes has a side-effect of failing the test execution - focus is kept on the terminal window instead of test stage and one of the test cases fires Control+C key combo interrupting the test execution
      - QPathTest.executionError - intermittently timeouts because the test Stage did not have focus when executing the test.

      Above tests need to ensure the focus is on test Stage before proceeding.

      There is also a collection of TextAreaBehaviorRobotTest tests which happen to fail on my machine, maybe for similar reason - investigate and fix if it's related, or file a separate bug to fix those tests.

      Happen on my Windows 11 machine with latest available update. Did not test other platforms.

            lkostyra Lukasz Kostyra
            lkostyra Lukasz Kostyra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: