Skip to content
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

8168388: GetMousePositionTest fails with the message "Mouse position should not be null" #6028

Closed
wants to merge 4 commits into from

Conversation

azuev-java
Copy link
Member

@azuev-java azuev-java commented Oct 20, 2021


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8168388: GetMousePositionTest fails with the message "Mouse position should not be null"

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6028/head:pull/6028
$ git checkout pull/6028

Update a local copy of the PR:
$ git checkout pull/6028
$ git pull https://git.openjdk.java.net/jdk pull/6028/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6028

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6028.diff

…should not be null"

Moved frame creation, modification and disposal to EDT
Added reasonable autodelay to robot
Made test frames undecorated
Removed test exclusion from ProblemList.txt
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 20, 2021

👋 Welcome back kizune! 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 openjdk bot commented Oct 20, 2021

@azuev-java 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 label Oct 20, 2021
@azuev-java
Copy link
Member Author

@azuev-java azuev-java commented Oct 20, 2021

The main reason is that the second test frame is so small that if Window Manager decorations are tall enough mouse ended up on top of the frame border thus formally outside of the frame content. The main idea is to make frames undecorated so WM decorations do not interfere with the testing. Also did some general cleanup like moving frame manipulations to EDT, set the autodelay to a reasonable number and get rid of the statically provided coordinates for the last mouse position.

@openjdk openjdk bot added the rfr label Oct 20, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 20, 2021

Webrevs


/*
* @test
* @key headful
* @bug 8012026 8196435
* @library ../../regtesthelpers
Copy link
Contributor

@prsadhuk prsadhuk Oct 20, 2021

Choose a reason for hiding this comment

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

Why do you need this?

Copy link
Member Author

@azuev-java azuev-java Oct 20, 2021

Choose a reason for hiding this comment

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

I wanted to use Util to use some helper methods but then decided not to change that.

try{
constructTestUI();
try {
SwingUtilities.invokeAndWait(GetMousePositionWithOverlay::constructTestUI);
Copy link
Contributor

@prsadhuk prsadhuk Oct 20, 2021

Choose a reason for hiding this comment

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

Do we need EDT as it is constructing a Frame and not a JFrame

Copy link
Member Author

@azuev-java azuev-java Oct 20, 2021

Choose a reason for hiding this comment

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

It does not hurt so i tend to use it just to make execution more streamlined.

@mrserb
Copy link
Member

@mrserb mrserb commented Oct 20, 2021

Please confirm that an updated test still can be used for JDK-8012026.

@azuev-java
Copy link
Member Author

@azuev-java azuev-java commented Oct 20, 2021

Please confirm that an updated test still can be used for JDK-8012026.

Yes it does. In general the logic of the test has not changed i just removed false negative due to the mouse position was overlapped by the WM window decorations.

Copy link
Contributor

@prsadhuk prsadhuk left a comment

SInce you are touching the test, maybe you can consider calling dispose in finally block rather than being called so many times in the test.

…on to the unexpected exception handler for easier triage in the future.
@azuev-java
Copy link
Member Author

@azuev-java azuev-java commented Oct 20, 2021

SInce you are touching the test, maybe you can consider calling dispose in finally block rather than being called so many times in the test.

Fixed.

mrserb
mrserb approved these changes Oct 21, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 21, 2021

@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:

8168388: GetMousePositionTest fails with the message "Mouse position should not be null"

Reviewed-by: psadhukhan, serb

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 288 new commits pushed to the master branch:

  • 09f5235: 8275405: Linking error for classes with lambda template parameters and virtual functions
  • a120937: 8274988: G1: refine G1SegmentedArrayAllocOptions and G1CardSetAllocOptions
  • c7a80e6: 8275607: G1: G1CardSetAllocator::drop_all needs to call G1SegmentedArray::drop_all
  • af7c56b: 8275167: x86 intrinsic for unsignedMultiplyHigh
  • cea3f01: 8275666: serviceability/jvmti/GetObjectSizeClass.java shouldn't have vm.flagless
  • d1e3ca4: 8233558: [TESTBUG] WindowOwnedByEmbeddedFrameTest.java fails on macos
  • 913f928: 8273507: Convert test/jdk/java/nio/channels/Channels/TransferTo.java to TestNG test
  • 0021a2f: 8275449: Add linux-aarch64-zero build profile
  • 46b5bfb: 8233648: [TESTBUG] DefaultMenuBarTest.java failing on macos
  • bbc6061: 8272614: Unused parameters in MethodHandleNatives linking methods
  • ... and 278 more: https://git.openjdk.java.net/jdk/compare/67e52a3078b0e7e522297c6008f5ac3792937c6a...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 ready label Oct 21, 2021
} catch (Exception e) {
if (e instanceof RuntimeException) {
Copy link
Contributor

@prsadhuk prsadhuk Oct 21, 2021

Choose a reason for hiding this comment

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

Do we need this catch block? I guess main() throws Exception so we can just have try-finally block, no?

Copy link
Member Author

@azuev-java azuev-java Oct 21, 2021

Choose a reason for hiding this comment

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

The catch block was already there and i decided not to remove it and moved the rest of the code instead of the try block.

Copy link
Contributor

@prsadhuk prsadhuk Oct 21, 2021

Choose a reason for hiding this comment

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

I know it was already there but since you are touching the test, it might be better to better the code to remove unneeded block, as here we are just catching exception and rethrowing, when we already have main() signature having "throws Throwable"

Copy link
Member Author

@azuev-java azuev-java Oct 21, 2021

Choose a reason for hiding this comment

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

Ok, i removed it.

@azuev-java
Copy link
Member Author

@azuev-java azuev-java commented Oct 21, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Oct 21, 2021

Going to push as commit 0c3eaea.
Since your change was applied there have been 288 commits pushed to the master branch:

  • 09f5235: 8275405: Linking error for classes with lambda template parameters and virtual functions
  • a120937: 8274988: G1: refine G1SegmentedArrayAllocOptions and G1CardSetAllocOptions
  • c7a80e6: 8275607: G1: G1CardSetAllocator::drop_all needs to call G1SegmentedArray::drop_all
  • af7c56b: 8275167: x86 intrinsic for unsignedMultiplyHigh
  • cea3f01: 8275666: serviceability/jvmti/GetObjectSizeClass.java shouldn't have vm.flagless
  • d1e3ca4: 8233558: [TESTBUG] WindowOwnedByEmbeddedFrameTest.java fails on macos
  • 913f928: 8273507: Convert test/jdk/java/nio/channels/Channels/TransferTo.java to TestNG test
  • 0021a2f: 8275449: Add linux-aarch64-zero build profile
  • 46b5bfb: 8233648: [TESTBUG] DefaultMenuBarTest.java failing on macos
  • bbc6061: 8272614: Unused parameters in MethodHandleNatives linking methods
  • ... and 278 more: https://git.openjdk.java.net/jdk/compare/67e52a3078b0e7e522297c6008f5ac3792937c6a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 21, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 21, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 21, 2021

@azuev-java Pushed as commit 0c3eaea.

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

@azuev-java azuev-java deleted the JDK-8168388 branch Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client integrated
3 participants