Skip to content

Conversation

@azvegint
Copy link
Member

@azvegint azvegint commented Jan 28, 2025

Several TrayIcon tests are trying to click on the system tray icon with Robot using XTest API.

Basically we have the same kind of failures as before, e.g. JDK-8280990

the reason is this is using XTEST, an X11 protocol which will not work outside of X11.

In other words, the emulated input event reaches the X11 clients, but not the Wayland compositor which is the actual display server but also the X11 window manager in Wayland, the component which is in charge of moving/resizing/stacking the windows.

I also tested the same tests by clicking manually instead of using the robot, and it works as expected.
So for now, skip those tests on Wayland (and do some minor cleanup).

Testing after modifications is also green.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23329/head:pull/23329
$ git checkout pull/23329

Update a local copy of the PR:
$ git checkout pull/23329
$ git pull https://git.openjdk.org/jdk.git pull/23329/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23329

View PR using the GUI difftool:
$ git pr show -t 23329

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23329.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 28, 2025

👋 Welcome back azvegint! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 28, 2025

@azvegint This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland

Reviewed-by: aivanov, dnguyen

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 80 new commits pushed to the master branch:

  • 651ac3c: 6899304: java.awt.Toolkit.getScreenInsets(GraphicsConfiguration) returns incorrect values
  • 2d6045a: 8301875: java.util.TimeZone.getSystemTimeZoneID uses C library default file mode
  • 13d852a: 8349017: Update ML tests to verify against ACVP 1.1.0.38 version
  • 137ad5d: 8348976: MemorySegment::reinretpret should be force inlined
  • 7764742: 8348909: [BACKOUT] Implement a better allocator for downcalls
  • fcd5ebc: 8292944: Noisy output when running make help the first time
  • bba6a8f: 8349143: All make control variables need special propagation
  • ee87d18: 8348658: [AArch64] The node limit in compiler/codegen/TestMatcherClone.java is too strict
  • a414a59: 8344983: [PPC64] Rename ConditionRegisters
  • 5878e45: 8348998: Split out PreInit.gmk from Init.gmk
  • ... and 70 more: https://git.openjdk.org/jdk/compare/ad01dfb670215a35d4151c7129c9086888e1f9e8...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 28, 2025
@openjdk
Copy link

openjdk bot commented Jan 28, 2025

@azvegint The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Jan 28, 2025
});

robot.mouseMove(0, 0);
robot.mouseMove(100, 0);
Copy link
Member Author

@azvegint azvegint Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it away from the top left corner, because it can trigger a hot corner in Gnome(X11 session), so the following tests may fail.

@mlbridge
Copy link

mlbridge bot commented Jan 28, 2025

Webrevs

@mlbridge
Copy link

mlbridge bot commented Jan 28, 2025

Mailing list message from Davide Perini on client-libs-dev:

I don't know what kind of tests you are running but TrayIcon is broken
on most Linux systems:
https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8341144

No one is still using xembed for trayicon, Ubuntu has some sort of
compatibility when running GNOME, but it's broken on KDE.

On Windows does not work better:
https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8341173
https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8323977

TrayIcon is rotting in the current state, it uses 20+ years old APIs,
I think that it needs a refresh instead of a "skip of some tests".

Davide

On 28/01/2025 12:36, Alexander Zvegintsev wrote:

@azvegint azvegint changed the title 8348675: TrayIcon tests fails in Ubuntu 24.10 wayland 8348675: TrayIcon tests fail in Ubuntu 24.10 wayland Jan 28, 2025
@openjdk openjdk bot changed the title 8348675: TrayIcon tests fail in Ubuntu 24.10 wayland 8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland Jan 28, 2025
} else if (!SystemTray.isSupported()) {
throw new SkippedException("SystemTray is not supported on this platform.");
} else {
if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Platform.isWindows() could work better… as well Platform.isOSX() for Mac.

The case SystemTrayIconHelper.isOel7orLater() should probably also throw SkippedException.

Comment on lines +75 to +79
"in Windows 7/10, which is behavior by default.\n" +
"Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
"\"Always show all icons and notifications on the taskbar\" true " +
"to avoid this problem. Or change behavior only for Java SE " +
"tray icon.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These instructions are outdated, at the same time, they're visible only on the test log… I'd rather leave them as is — it's out of scope to amend the instructions to be accurate for Windows 10 and 11.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 31, 2025
Copy link
Contributor

@DamonGuy DamonGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the same issue when testing on Wayland for some tests regarding SystemTray/TrayIcon. One of the ones I looked at was actually TrayIconPopupTest, which you covered here. Makes sense to just skip them for now where possible.

@azvegint
Copy link
Member Author

azvegint commented Feb 3, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Feb 3, 2025

Going to push as commit 6f4fc82.
Since your change was applied there have been 83 commits pushed to the master branch:

  • 9aa6d09: 8326485: Assertion due to Type.addMetadata adding annotations to already-annotated type
  • 2cce5ee: 8349142: [JMH] compiler.MergeLoadBench.getCharBV fails
  • 305bbda: 8348402: PerfDataManager stalls shutdown for 1ms
  • 651ac3c: 6899304: java.awt.Toolkit.getScreenInsets(GraphicsConfiguration) returns incorrect values
  • 2d6045a: 8301875: java.util.TimeZone.getSystemTimeZoneID uses C library default file mode
  • 13d852a: 8349017: Update ML tests to verify against ACVP 1.1.0.38 version
  • 137ad5d: 8348976: MemorySegment::reinretpret should be force inlined
  • 7764742: 8348909: [BACKOUT] Implement a better allocator for downcalls
  • fcd5ebc: 8292944: Noisy output when running make help the first time
  • bba6a8f: 8349143: All make control variables need special propagation
  • ... and 73 more: https://git.openjdk.org/jdk/compare/ad01dfb670215a35d4151c7129c9086888e1f9e8...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 3, 2025
@openjdk openjdk bot closed this Feb 3, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 3, 2025
@openjdk
Copy link

openjdk bot commented Feb 3, 2025

@azvegint Pushed as commit 6f4fc82.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants