Skip to content

JDK-8222323: ChildAlwaysOnTopTest.java fails with "RuntimeException: Failed to unset alwaysOnTop" #8509

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

Closed
wants to merge 5 commits into from

Conversation

honkar-jdk
Copy link
Contributor

@honkar-jdk honkar-jdk commented May 2, 2022

This test case tests the functionality of setAlwaysOnTop.
Documentation on setAlwaysOnTop: Link

The following test case was seen to fail on windows and linux platforms. With the proposed fix, the test case works on all platforms.

The test case tests alwaysOnTop for the following three cases:

  1. JDialog with no parent/owner
  2. JDialog with JFrame as owner
  3. JDialog with another JDialog as owner

Each of the three cases mentioned above is tested under 3 scenarios:
Screen Shot 2022-05-02 at 2 02 30 PM


Progress

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

Issue

  • JDK-8222323: ChildAlwaysOnTopTest.java fails with "RuntimeException: Failed to unset alwaysOnTop"

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8509

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 2, 2022

👋 Welcome back honkar-jdk! 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 openjdk bot added the rfr Pull request is ready for review label May 2, 2022
@openjdk
Copy link

openjdk bot commented May 2, 2022

@honkar-jdk 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 2, 2022
@mlbridge
Copy link

mlbridge bot commented May 2, 2022

Webrevs

saveScreenCapture(caseNo , 1);
throw new RuntimeException("Scenario 1: alwaysOnTop window is "+
"sent back by another child window with setVisible(). "
+ color);
Copy link
Member

Choose a reason for hiding this comment

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

I see that we are doing a number of test scenarios but test fails immediately when first error occurs. Can we continue testing, save all screenshots and remember all the failures and then fail at the end if there were errors listing all the errors in all the LaF's that were happened during the run?

Copy link
Contributor Author

@honkar-jdk honkar-jdk May 4, 2022

Choose a reason for hiding this comment

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

@azuev-java Thank you for the suggestion. I can definitely add this functionality to the test for better failure analysis.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's a reasonable suggestion in general to bear in mind when writing tests.
I've seen tests which bail at the first failure and you wish you knew how the rest of it worked out ..
Like (say) a test that iterates over the 4 available L&Fs might be a case.

Copy link
Contributor Author

@honkar-jdk honkar-jdk May 4, 2022

Choose a reason for hiding this comment

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

@prrace Thank you for the inputs. Will make a note to add it for future similar test scenarios too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated test case to continue testing all scenarios and to throw Exception at the end (in case test fails in any of the scenarios)

});
System.out.println("Case "+ caseNo + errorMsg[scenarioNo - 1]
+" Expected Color: "+ expectedColor +" vs Actual Color: "
+ actualColor);
Copy link
Member

Choose a reason for hiding this comment

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

Here instead of just printing out the error i would save it into the static StringBuilder that i would allocate at the beginning of the test. Then when we are concluding testing i would just check if the buffer is empty and if it is not i would throw an RuntimeException with the buffer content. This way we would have all the errors reported by the JavaTest suite in the HTML report and this will make it into the whatever testing environment report we are running tests in. Also that would replace the errorFlag variable since emptiness of the buffer will be an indication of test pass.

Copy link
Contributor Author

@honkar-jdk honkar-jdk May 5, 2022

Choose a reason for hiding this comment

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

@azuev-java Thank you for the suggestion. I have updated the PR with the changes.

@openjdk
Copy link

openjdk bot commented May 5, 2022

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

8222323: ChildAlwaysOnTopTest.java fails with "RuntimeException: Failed to unset alwaysOnTop"

Reviewed-by: prr, kizune

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

  • 4957bc7: 8286056: AArch64: clarify uses of MacroAssembler::far_call/MacroAssembler::far_jump
  • e7adc28: 8284675: "jpackage.exe" creates application launcher without Windows Application Manfiest
  • 9644a31: 8285616: [macos] Incorrect path for launcher-as-service.txt in .cfg file
  • 2f995c8: 8286199: ProblemList jdk/jshell/ExternalEditorTest.java
  • 2293448: 8272352: Java launcher can not parse Chinese character when system locale is set to UTF-8
  • 1bba640: 8284027: vmTestbase/nsk/jvmti/GetAllThreads/allthr001/ is failing
  • 5ac7186: 8282559: Allow multiple search terms in javadoc search
  • 7022543: 8286195: ProblemList test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java
  • ede06c3: 8282060: RemoteRuntimeImageTest is not actually testing on JDK 8
  • dce860a: 8285947: Avoid redundant HashMap.containsKey calls in ZoneName
  • ... and 10 more: https://git.openjdk.java.net/jdk/compare/bb022b24cfdad9d6826140c6b26c46f480e7457d...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@prrace, @azuev-java) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 5, 2022
@honkar-jdk
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 5, 2022
@openjdk
Copy link

openjdk bot commented May 5, 2022

@honkar-jdk
Your change (at version 666a285) is now ready to be sponsored by a Committer.

@prrace
Copy link
Contributor

prrace commented May 9, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented May 9, 2022

Going to push as commit 837928b.
Since your change was applied there have been 54 commits pushed to the master branch:

  • 397d095: 8285743: Ensure each IntegerPolynomial object is only created once
  • 29ccb8f: 8285914: AppCDS crash when using shared archive with old class file
  • fe6e0c0: 8286371: Avoid use of deprecated str[n]icmp
  • 97a9835: 8274517: java/util/DoubleStreamSums/CompensatedSums.java fails with expected [true] but found [false]
  • 034f20f: 8212136: Remove finalizer implementation in SSLSocketImpl
  • 36e4df9: 8285516: clearPassword should be called in a finally try block
  • b849efd: 8285923: [REDO] JDK-8285802 AArch64: Consistently handle offsets in MacroAssembler as 64-bit quantities
  • f143386: 8286293: Tests ShortResponseBody and ShortResponseBodyWithRetry should use less resources
  • 64b05cc: 8286346: 3-parameter version of AllocateHeap should not ignore AllocFailType
  • 4f5d73f: 8286294: ForkJoinPool.commonPool().close() spins
  • ... and 44 more: https://git.openjdk.java.net/jdk/compare/bb022b24cfdad9d6826140c6b26c46f480e7457d...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 9, 2022
@openjdk openjdk bot closed this May 9, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels May 9, 2022
@openjdk
Copy link

openjdk bot commented May 9, 2022

@prrace @honkar-jdk Pushed as commit 837928b.

💡 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