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
8304922: [testbug] SliderTooltipNPETest fails on Linux #1119
Conversation
👋 Welcome back kpk! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
It doesn't work for me.
@@ -94,6 +94,7 @@ private void dragSliderAfterTooltipDisplayed(int dragDistance) throws Exception | |||
slider.getLayoutX() + slider.getLayoutBounds().getWidth()/2), | |||
(int)(scene.getWindow().getY() + scene.getY() + | |||
slider.getLayoutY() + slider.getLayoutBounds().getHeight()/2)); | |||
Toolkit.getToolkit().firePulse(); |
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.
A system test should not need to use firePulse
, and I can't think why this would help. In any case, I still see the failure on my Ubuntu 22.04 VM.
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.
Oh Okay! Let me check on that again.
Looks like the failure is not consistent in all the Linux systems. Even without the fix it was failing only on the first run for me in VM as well as in Ubuntu workstation.
Since |
@karthikpandelu This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@kevinrushforth could you please check the updated fix whenever possible? |
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.
It still fails the first time I run it. I ran it on a physical machine, and I now know why. I can make it fail every time by moving the mouse away from the center of the screen (so that it is outside of where the window will appear).
The problem is that the tooltip will not show up on Linux if you directly move the cursor with Robot to be over the control without it ever having been somewhere else in the window first. So the only reason it works on subsequent runs is that the mouse is left in a position such that it will be over the window when the test is run the next time.
In general, it's also a good idea to click in the window to ensure that it is activated. The only other robot-based test that shows a Tooltip first moves the mouse to the upper-left corner of the scene and then does a mouse click. Adding that code to your patch causes it to work.
So I recommend adding the following to the test (in addition to the changes you already made, which look good).
diff --git a/tests/system/src/test/java/test/robot/javafx/scene/SliderTooltipNPETest.java b/tests/system/src/test/java/test/robot/javafx/scene/SliderTooltipNPETest.java
--- a/tests/system/src/test/java/test/robot/javafx/scene/SliderTooltipNPETest.java
+++ b/tests/system/src/test/java/test/robot/javafx/scene/SliderTooltipNPETest.java
@@ -88,6 +88,13 @@ public class SliderTooltipNPETest {
}
private void dragSliderAfterTooltipDisplayed(int dragDistance) throws Exception {
+ Util.runAndWait(() -> {
+ // Click somewhere in the Stage to ensure that it is active
+ robot.mouseMove((int)(scene.getWindow().getX() + scene.getX()),
+ (int)(scene.getWindow().getY() + scene.getY()));
+ robot.mouseClick(MouseButton.PRIMARY);
+ });
+
Thread.sleep(1000); // Wait for slider to layout
Util.runAndWait(() -> {
Thanks for the suggestion @kevinrushforth. Made changes according to your comments. Please check. |
@karthikpandelu 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 42 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 |
/integrate |
Going to push as commit 72be85e.
Your commit was automatically rebased without conflicts. |
@karthikpandelu Pushed as commit 72be85e. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The test was failing on the first run and then it was not failing. Cause for the failure looked to be the UI state not getting updated. Hence added call to
Toolkit
firePulse
method.Able to run the test consistently without failure in Linux after the fix.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1119/head:pull/1119
$ git checkout pull/1119
Update a local copy of the PR:
$ git checkout pull/1119
$ git pull https://git.openjdk.org/jfx.git pull/1119/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1119
View PR using the GUI difftool:
$ git pr show -t 1119
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1119.diff
Webrev
Link to Webrev Comment