-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8266249: javax/swing/JPopupMenu/7156657/bug7156657.java fails on macOS #3844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Take into account screen offset of the popup Added saving of the screenshots in case of test failure
👋 Welcome back kizune! A progress list of the required criteria for merging this PR into |
@azuev-java The following label will be automatically applied to this pull request:
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. |
Webrevs
|
As this is an intermittent failure (failed once in 40 iterations as mentioned in JBS), can you please run multiple iterations of the test in CI system without JTREG_RETRY_COUNT option to confirm there is no failure now? |
Added test run link to the bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I had doubt whether we will have write access to test path to create new files in our CI systems, but it looks like we can. Verified it by making the test fail purposefully in our CI.
@azuev-java 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:
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 90 new commits pushed to the
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 |
I'm not sure about this change...Maybe changing frame location from (0,0) at l192 to middle of screen though selLocationRelativeTo() may be enough to make the test more stable in CI systems. |
Ok, not that it makes any difference so there you go.
Well, when comparison fails it is kind of too late to get "Before" and "After" screenshots, because "Before" is no longer there and "After" can also not be the same. And i'm saving these screenshots only if comparison fails so the performance impact is negligible.
Ok, fixed. |
/integrate |
@azuev-java Since your change was applied there have been 90 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 9b76955. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
@@ -103,24 +109,56 @@ public void run() { | |||
Rectangle popupRectangle = Util.invokeOnEDT(new Callable<Rectangle>() { | |||
@Override | |||
public Rectangle call() throws Exception { | |||
return popupMenu.getBounds(); | |||
return new Rectangle(popupMenu.getLocationOnScreen(), | |||
popupMenu.getSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that the getBounds method returns the wrong coordinate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per documentation - it returns coordinates related to the parent. Parent was a frameless window that we asked to go to 0,0 which means that parent coordinates == screen coordinates. With one exception - on Mac OS the menu bar is on the top and the window got shifted by the insets introduced by it. So, yes, in this case coordinates were incorrect. Or rather we used the wrong method to retrieve them.
Fixed popup position taking into account its offset
Added a lot of screenshots taking to better understand failures should they happen down the line
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3844/head:pull/3844
$ git checkout pull/3844
Update a local copy of the PR:
$ git checkout pull/3844
$ git pull https://git.openjdk.java.net/jdk pull/3844/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3844
View PR using the GUI difftool:
$ git pr show -t 3844
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3844.diff