Skip to content

8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine #25244

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

mickleness
Copy link
Contributor

@mickleness mickleness commented May 15, 2025

Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR.

I added a little bit of logging that might also help identify what's happening.

Does anyone have any more suggestions?


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-8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25244

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

Using diff file

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

Using Webrev

Link to Webrev Comment

mickleness and others added 14 commits May 22, 2022 04:50
Merge openjdk/jdk into mickleness/jdk
Updating mickleness/jdk from openjdk/jdk
updating to openjdk/jdk
I could reproduce failures with this test if I changed every call to Robot.delay to 1ms.

(I could not reproduce failures from the master branch on my machine.)

I'm increasing the delay before we start capturing pixels from 100ms to 1000ms.
This may be a red herring, but I think it's weird that the test failed because it spotted instances of the color 0x373737. I don't know exactly where that would appear in the test app's UI.
@bridgekeeper
Copy link

bridgekeeper bot commented May 15, 2025

👋 Welcome back mickleness! 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 May 15, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

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

openjdk bot commented May 15, 2025

@mickleness 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 May 15, 2025
@mlbridge
Copy link

mlbridge bot commented May 15, 2025

Webrevs

@@ -128,7 +128,7 @@ private static void test(Robot robot, AbstractButton buttonToClick,
robot.delay(20);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);

robot.delay(100);
robot.delay(1000);
Copy link
Member

Choose a reason for hiding this comment

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

it will be useful to add the same delay before the first call to test, right after invokeAndWait.....setVisible(...)
Also please move creation and access_to all Swing components to EDT(button, radioButton1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an additional delay. I'm not sure exactly what refactor you're looking for, but I rewrote the test to put more in the EDT.

(I double-checked that the test still passes, but that doesn't prove much since I've never reproduced a failure.)

I did try at one point blocking the testing thread until the EDT had a chance to complete an invokeLater runnable, but that didn't seem to make a difference so I didn't commit it.

This was requested here:
openjdk#25244 (comment)

So now we'll pause at least 1.1s before the first call to `jc.getLocationOnScreen`, and at least 2.1s before the first call to `robot.getPixelColor(x, y)`.

(getLocationOnScreen has never failed with an IllegalStateException.)
This was requested here:
openjdk#25244 (comment)

mrserb asked: "Also please move creation and access_to all Swing components to EDT"

(I'm not sure this will help much? My understanding was *creation* of Swing components could happen off the EDT as long as they were made displayable on the EDT.)

Now we still call jc.getLocationOnScreen off the EDT. If that posed a thread-based problem it'd probably manifest as a IllegalComponentStateException, which is not mentioned in 8356061.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
client client-libs-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants