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

7903193: [jtreg] build and test failures using JDK 18 #190

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jaikiran
Copy link
Member

@jaikiran jaikiran commented Mar 10, 2024

Can I please get a review of this test only changes, which proposes to address the current failure in jtreg self tests when Java 18 or higher is used to build and test jtreg?

As noted in the following issues:
https://bugs.openjdk.org/browse/CODETOOLS-7903193
https://bugs.openjdk.org/browse/CODETOOLS-7903646
https://bugs.openjdk.org/browse/CODETOOLS-7903645

these self tests in jtreg which rely on SecurityManager, no longer pass when used with Java 18 or higher, since starting Java 18 the setting of SecurityManager throws an UnsupportedOperationException.

Changes in this PR, include updates to test files which check for the Java version being used to run these tests and then decide whether or not to include some specific tests that only pass when a SecurityManager is set.

I've run these changes locally (on macos M1) and on a linux setup, both with Java 17 and Java 21. The tests all pass on these versions.

I've also run this on a headless system to make sure the ReportOnlyTest.gmk does indeed properly check the correct values on a headless system (both Java 17 and 21). I think this change should address the issue that Ludvig @LudwikJaniuk had run into.


Progress

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

Issues

  • CODETOOLS-7903193: [jtreg] build and test failures using JDK 18 (Bug - P3)
  • CODETOOLS-7903645: tests that set SecurityManager fail due to UnsupportedOperationException in Java 21 (Bug - P4)
  • CODETOOLS-7903646: test/BasicAgent.vm fails when run with Java 21 (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jtreg.git pull/190/head:pull/190
$ git checkout pull/190

Update a local copy of the PR:
$ git checkout pull/190
$ git pull https://git.openjdk.org/jtreg.git pull/190/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 190

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/190.diff

Webrev

Link to Webrev Comment

@jaikiran
Copy link
Member Author

/issue 7903645

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 10, 2024

👋 Welcome back jpai! 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 Mar 10, 2024
@openjdk
Copy link

openjdk bot commented Mar 10, 2024

@jaikiran
Adding additional issue to issue list: 7903645: tests that set SecurityManager fail due to UnsupportedOperationException in Java 21.

@jaikiran
Copy link
Member Author

/issue 7903646

@openjdk
Copy link

openjdk bot commented Mar 10, 2024

@jaikiran
Adding additional issue to issue list: 7903646: test/BasicAgent.vm fails when run with Java 21.

@mlbridge
Copy link

mlbridge bot commented Mar 10, 2024

Webrevs

@LudwikJaniuk
Copy link

With your changes, I get All (196) selected tests completed successfully after running the test make target. So it seems to work for me!

@jaikiran
Copy link
Member Author

Thank you Ludvig for testing this. I'm happy to hear that it now passes.

@openjdk
Copy link

openjdk bot commented Mar 13, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

Copy link
Collaborator

@jonathan-gibbons jonathan-gibbons left a comment

Choose a reason for hiding this comment

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

It would be better to come up with a better way for jtreg to deal with the lack of a security manager.

That being, said, we obviously are using jtreg to run on recent versions of JDK, and this PR is just about fixing the tests, not about changing jtreg functionality itself, at this time.

make/build.sh Outdated
@@ -784,6 +785,7 @@ make ASMTOOLS_JAR="${ASMTOOLS_JAR}" \\
JUNIT_NOTICES="${JUNIT_NOTICES}" \\
TESTNG_JARS="${TESTNG_JARS}" \\
TESTNG_NOTICES="${TESTNG_NOTICES}" \\
JAVA_SPECIFICATION_VERSION="${JAVA_SPECIFICATION_VERSION}" \\
Copy link
Collaborator

@jonathan-gibbons jonathan-gibbons Mar 19, 2024

Choose a reason for hiding this comment

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

Note the list of variables is sorted alphabetically.

@@ -40,6 +35,7 @@ $(BUILDTESTDIR)/ReportOnlyTest.ok: $(BUILDTESTDIR)/Basic.othervm.ok \
$(JTREG_IMAGEDIR)/bin/jtreg
JAVA_HOME=$(JDKHOME) CLASSPATH=$(ABSCLASSDIR) \
$(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \
-k:!needDisplay \
Copy link
Collaborator

@jonathan-gibbons jonathan-gibbons Mar 19, 2024

Choose a reason for hiding this comment

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

This seems unrelated to the security manager changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry Jon, I forgot to reply to this comment. I'll refresh this PR against latest master branch and refresh my memory about this change and respond shortly.

Copy link
Member Author

Choose a reason for hiding this comment

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

With the other PR #223 now integrated, this part of the change in this PR is no longer needed. So I've removed it in the latest updates to this PR.

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 17, 2024

@jaikiran 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!

@bridgekeeper
Copy link

bridgekeeper bot commented May 15, 2024

@jaikiran This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@jaikiran
Copy link
Member Author

/open

@openjdk openjdk bot reopened this Aug 24, 2024
@openjdk
Copy link

openjdk bot commented Aug 24, 2024

@jaikiran This pull request is now open

@jaikiran
Copy link
Member Author

I've now updated the PR to only contain the Java 18+ changes. I have verified the latest changes against Java versions less than 18 as well as greater than 18, both when headless is true and when headless is false. All self tests continue to pass and jtreg builds successfully in all these combinations.

@sormuras
Copy link
Member

Heads-up for after #217 has been integrated, the basic test number counters need an update, again.

@jaikiran
Copy link
Member Author

I've now updated the PR after merging against latest master. I have verified that with these changes, all self tests continue to pass with Java versions less than 18 as well as greater than 18, both when headless is true and when headless is false.

Copy link
Member

@sormuras sormuras left a comment

Choose a reason for hiding this comment

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

Looks good to me - @jonathan-gibbons do you agree?

@sormuras
Copy link
Member

sormuras commented Oct 17, 2024

@jaikiran Can you please replace the 17 with a 21 in https://github.com/jaikiran/jtreg/blob/60809c4da0f2ef18540df4328113f898d032497b/.github/workflows/test.yml#L24

That should make a) the test workflow download an Oracle JDK and b) also run the build (compilation and tests) on a JDK 18+.

Background: https://www.oracle.com/java/technologies/jdk-script-friendly-urls/

JDK 17 LTS and GraalVM for JDK 17 LTS latest URLs are no longer available. They were available for three years after GA and one year after the next JDK LTS release. They stopped working on October of 2024. Java SE Subscribers and customers using Oracle Cloud Infrastructure can continue getting updates for JDK 17 and GraalVM for JDK 17; other users should migrate to the next LTS.

The archive URLs for each release will continue to work for at least a year after the corresponding latest URLs stop being available.

Although the latest URLs for JDK 17 are no longer available, the archive URLs for JDK 17 LTS releases 17.0.12 and earlier continue to work until October of 2025; one year after the the corresponding latest URLs were disabled.

@jaikiran
Copy link
Member Author

@jaikiran Can you please replace the 17 with a 21 in https://github.com/jaikiran/jtreg/blob/60809c4da0f2ef18540df4328113f898d032497b/.github/workflows/test.yml#L24

That should make a) the test workflow download an Oracle JDK and b) also run the build (compilation and tests) on a JDK 18+.

I wasn't sure if we should do that change as part of this PR, so I created a separate branch which includes the changes in this PR plus the change to the JDK version in the github workflow file. That branch's job is currently in progress here https://github.com/jaikiran/jtreg/actions/runs/11385998691/job/31677151971

@jaikiran
Copy link
Member Author

If that build succeeds and if you think that we should include that change in this PR, let me know and I'll update this PR to include that change.

@sormuras
Copy link
Member

If that build succeeds and if you think that we should include that change in this PR, let me know and I'll update this PR to include that change.

Sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants