RFO: GUI tests for wakefield
Phil Race
philip.race at oracle.com
Wed Dec 10 19:54:58 UTC 2025
setVisible isn't required to be synchronous like that.
So tests that expect something to be actually on the screen need to wait
and/or check.
Over the years, we've stabilised many tests in this regard. It is an
ongoing process.
Having said that, I have to ask why Wayland is a special case.
Can you compare the X[wayland] vs wayland steps for window display ?
-phil.
On 12/10/2025 5:09, Maxim Kartashev wrote:
> Hi, All!
>
> Many tests in test/jdk/javax/swing/ or awt/ that we run turned out to
> be not very useful: they create some UI and then immediately return
> from main(). If such a test is executed under jtreg, jtreg will almost
> immediately call System.exit() and terminate the whole test. One
> concrete example
> is test/jdk/javax/swing/PopupFactory/8048506/bug8048506.java, but
> there are many more like this.
>
> Currently, running such tests on Linux/Xorg may cause a window to
> flash briefly, which could be enough time for the test to actually
> complete (but maybe not). Under Wayland, however, showing a window on
> the screen requires an involved, asynchronous process of negotiation
> with the server; this happens on EDT after setVisible(true) has
> returned already. Consequently, such tests under Wayland usually don't
> run long enough for a single pixel to be shown on the screen. The
> process exits at around the time the Wayland server agrees about the
> size and the role of the window.
>
> The specification of Component.setVisible() is vague, so I defer to
> the expertise of people on this list to determine which part is at
> fault and needs to be "fixed". Should such tests wait before exiting
> main()? Or should the Wayland toolkit guarantee that the window is
> indeed on the screen before setVisible(true) returns?
>
> Thanks in advance.
>
> Maxim.
More information about the wakefield-dev
mailing list