JDK-8367893 : StageFocusTest fails on some Linux systems
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx26
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • Submitted: 2025-09-17
  • Updated: 2025-09-20
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 :  
Relates :  
Description
I see the following failure on our Ubuntu 24.04 XWayland headful test system:

StageFocusTest > testStageHasFocusAfterShow(Stage) > [2] javafx.stage.Stage@2bd2b28e FAILED
    org.opentest4j.AssertionFailedError: Stage did not receive the key stroke generated by Robot! This might happen if the Stage did not receive focus after showing. Some tests might fail because of this. Try re-running the tests with '--no-daemon' flag in Gradle. ==> expected: <true> but was: <false>
        at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at app//org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
        at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
        at app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
        at app//test.robot.javafx.stage.StageFocusTest.testStageHasFocusAfterShow(StageFocusTest.java:218)

I suspect that this is a product bug, not a test bug, but we need to check.

Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1789 Date: 2025-04-22 12:01:56 +0000
20-09-2025

It does work with JDK-8354943
20-09-2025

This might be a problem on more than just Ubuntu 24.04 XWayland. I ran just this one test (as opposed to the entire test suite, which I usually run) on Ubuntu 22.04 using X.org and it failed there 2 out of 3 times. I am changing the title to be more generic and will change JDK-8367898 to skip the test on Linux regardless of whether it is running Wayland or X.org.
17-09-2025

I filed JDK-8367898 to skip this test until the underlying problem is fixed.
17-09-2025

One thing I'd like to try is to see if the fix for JDK-8354943 also fixes this bug.
17-09-2025