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

8260592: jpackage tests fail when Desktop is not supported #2291

Closed

Conversation

@shipilev
Copy link
Contributor

@shipilev shipilev commented Jan 28, 2021

If you run x86 configuration (cross-compiled on x86_64), then many tests would fail with:

$ CONF=linux-x86-server-fastdebug make images run-test TEST=tools/jpackage
...
can not load libgnomevfs-2.so
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.UnsupportedOperationException: Desktop API is not supported on the current platform
at java.desktop/java.awt.Desktop.getDesktop(Unknown Source)
at com.that/com.that.main.Florence.createInstance(Unknown Source)
at com.that/com.that.main.Florence.<clinit>(Unknown Source)
Failed to launch JVM
java.lang.AssertionError: Expected [0]. Actual [1]: Check command [/home/shade/trunks/jdk/build/linux-x86-server-fastdebug/test-support/jtreg_test_jdk_tools_jpackage/scratch/10/./testMainLauncherIsModular.ed4f638d/output/MainLauncherIsModularAddLauncherTest/bin/ModularAppLauncher](1) exited with 0 code

The tests probably need to check Desktop.isDesktopSupported(), similarly how they check GraphicsEnvironment.isHeadless().

Additional testing:

  • Linux x86_32 tools/jpackage (now pass)
  • Linux x86_64 tools/jpackage (still pass)

Progress

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

Issue

  • JDK-8260592: jpackage tests fail when Desktop is not supported

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2291/head:pull/2291
$ git checkout pull/2291

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 28, 2021

👋 Welcome back shade! 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 label Jan 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 28, 2021

@shipilev The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs label Jan 28, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 28, 2021

Webrevs

@@ -163,6 +163,12 @@ private static Hello createInstance() {
ex.printStackTrace();
}

if (!Desktop.isDesktopSupported()) {

This comment has been minimized.

@alexeysemenyukoracle

alexeysemenyukoracle Jan 28, 2021
Member

Would it make more sense to replace
if (GraphicsEnvironment.isHeadless())
with
if (GraphicsEnvironment.isHeadless() || !Desktop.isDesktopSupported())
without need to add another trace() call?

This comment has been minimized.

@shipilev

shipilev Jan 28, 2021
Author Contributor

I would prefer to have separate messages for "headless" and "desktop capable". I can merge these, if you insist.

This comment has been minimized.

@alexeysemenyukoracle

alexeysemenyukoracle Jan 28, 2021
Member

Duplicated messages are not much help in understanding control flow. I'd change the new message or merge conditions. Whatever you prefer.

This comment has been minimized.

@sashamatveev

sashamatveev Jan 29, 2021
Member

It is fine with me to have two separate messages for display and desktop, but it is better to move this check to top of function after if (GraphicsEnvironment.isHeadless()). No point to execute other code.

This comment has been minimized.

@shipilev

shipilev Jan 29, 2021
Author Contributor

Okay, I moved the check upwards. The trace message is left intact. Note it says "desktop", there, so it is not a duplicate message.

@openjdk
Copy link

@openjdk openjdk bot commented Jan 28, 2021

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

8260592: jpackage tests fail when Desktop is not supported

Reviewed-by: asemenyuk, herrick

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

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 Jan 28, 2021
@shipilev
Copy link
Contributor Author

@shipilev shipilev commented Jan 29, 2021

/integrate

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

@openjdk openjdk bot commented Jan 29, 2021

@shipilev Since your change was applied there have been 16 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 24a2621.

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

@shipilev shipilev deleted the shipilev:JDK-8260592-jpackage-no-desktop branch Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants