Skip to content

JDK-8297215: Update libs tests to use @enablePreview #11222

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 7 commits into from

Conversation

jddarcy
Copy link
Member

@jddarcy jddarcy commented Nov 17, 2022

Similar to an update recently done for langtools tests, update the libraries regression tests to take advantage of the @enablePreview jtreg feature.


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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11222

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11222.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 17, 2022

👋 Welcome back darcy! 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 Nov 17, 2022
@openjdk
Copy link

openjdk bot commented Nov 17, 2022

@jddarcy The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot-jfr
  • net
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org core-libs core-libs-dev@openjdk.org net net-dev@openjdk.org hotspot-jfr hotspot-jfr-dev@openjdk.org labels Nov 17, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 17, 2022

Webrevs

* @run testng/othervm --enable-preview BuilderTest
* @enablePreview
* @compile BuilderTest.java
* @run testng/othervm BuilderTest
Copy link
Contributor

@AlanBateman AlanBateman Nov 18, 2022

Choose a reason for hiding this comment

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

I assume @compile can be dropped from most of these tests now. Also I think /othervm can be dropped too because jtreg will always use othervm for tests that require --enable-preview. When the feature becomes permanent then it would mean dropping the @enablePreview tag, no other 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.

Right; ideally when the feature becomes non-preview the test update would just be removing the "@enablePreview" line. I didn't author these tests so I initially left any "othervm" directives in place since they aren't incorrect, just at worst a bit inefficient.

Copy link
Contributor

Choose a reason for hiding this comment

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

@enablePreview wasn't available when most of these tests were initially created. I changed some of to use this tag as part of other changes but didn't cover over the remaining tests that still use @compile --enable-preview -source ${jdk.version} ... and @run main/othervm --enable-preview .... I just scanned the tests in test/jdk/java/lang/Thread/virtual and they can all be changed the same way, if you want. If you leave it then we'll just change them at the next edit in this area.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I got most of those in the PR. There was a file or two I didn't update because not all the @compile/@run directives in the file used --enablePreview and the @enablePreview directive applies to all @compile and @run directives.

Copy link
Contributor

Choose a reason for hiding this comment

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

Most of the tests in test/jdk/java/lang/Thread/virtual/ still have @compile and othervm, is it possible you didn't push the update with those changes?

* @run testng/othervm --enable-preview JfrEvents
* @enablePreview
* @compile JfrEvents.java
* @run testng/othervm JfrEvents
Copy link
Contributor

Choose a reason for hiding this comment

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

This one needs to be /othervm.

* @compile --enable-preview -source ${jdk.version} Timeouts.java
* @run testng/othervm/timeout=180 --enable-preview Timeouts
* @enablePreview
* @compile Timeouts.java
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the @compile can be dropped from this one, doesn't matter.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

Latest update looks good, will make the test changes easy when features move from preview to permanent.

@openjdk
Copy link

openjdk bot commented Dec 1, 2022

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

8297215: Update libs tests to use @enablePreview

Reviewed-by: alanb, sspitsyn

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 1 new commit pushed to the master branch:

  • 5a5ced3: 8297830: aarch64: Make Address a discriminated union internally

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 Pull request is ready to be integrated label Dec 1, 2022
* @compile --enable-preview -source ${jdk.version} GetStackTraceWhenRunnable.java
* @run main/othervm --enable-preview -Djdk.virtualThreadScheduler.maxPoolSize=1 GetStackTraceWhenRunnable
* @enablePreview
* @compile GetStackTraceWhenRunnable.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Is the line 29 for compiling necessary?

@@ -34,7 +34,7 @@
* @requires vm.continuations
* @library /test/lib
* @run build TestClass1 TestClass2 TestClass3
* @compile --enable-preview -source ${jdk.version} ParallelTransformerLoaderTest.java
* @compile --enable-preview -source ${jdk.version} ParallelTransformerLoaderTest.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This change is strange. It is either not needed or missing something.

* @compile --enable-preview -source ${jdk.version} SwitchBootstrapsTest.java
* @run testng/othervm --enable-preview SwitchBootstrapsTest
* @enablePreview
* @compile SwitchBootstrapsTest.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Is the line 41 for compiling necessary?

@@ -28,12 +28,12 @@
* @requires vm.debug != true
* @modules jdk.httpserver
* @library /test/lib
* @compile --enable-preview -source ${jdk.version} HttpALot.java
* @enablePreview
* @compile HttpALot.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Is the line 32 for compiling necessary?

* @compile --enable-preview -source ${jdk.version} InterruptHttp.java
* @run main/othervm --enable-preview InterruptHttp
* @enablePreview
* @compile InterruptHttp.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Is the line 29 for compiling necessary?

* @compile --enable-preview -source ${jdk.version} TestThreadSleepEvent.java
* @run main/othervm --enable-preview jdk.jfr.event.runtime.TestThreadSleepEvent
* @enablePreview
* @compile TestThreadSleepEvent.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Is the line 44 for compiling necessary?

* @compile --enable-preview -source ${jdk.version} TestManyVirtualThreads.java
* @run main/othervm --enable-preview jdk.jfr.threading.TestManyVirtualThreads
* @enablePreview
* @compile TestManyVirtualThreads.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Not sure the line 47 for compiling is necessary?

* @compile --enable-preview -source ${jdk.version} TestNestedVirtualThreads.java
* @run main/othervm --enable-preview jdk.jfr.threading.TestNestedVirtualThreads
* @enablePreview
* @compile TestNestedVirtualThreads.java
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Not sure the line 45 for compiling is necessary?

Copy link
Contributor

@sspitsyn sspitsyn 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.
Posted several nits though.
Thanks,
Serguei

* @compile --enable-preview -source ${jdk.version} TestDeepVirtualStackTrace.java
* @run main/othervm --enable-preview -XX:FlightRecorderOptions:stackdepth=2048
* @enablePreview
* @compile TestDeepVirtualStackTrace.java
Copy link
Member

Choose a reason for hiding this comment

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

Is compilation needed here?

Copy link
Member Author

@jddarcy jddarcy Dec 1, 2022

Choose a reason for hiding this comment

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

For the two tests that compiled a single file, I removed the @compile directive. Any additional refactoring left for future work.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels Dec 1, 2022
@jddarcy
Copy link
Member Author

jddarcy commented Dec 1, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Dec 1, 2022

Going to push as commit 770ff5a.
Since your change was applied there have been 2 commits pushed to the master branch:

  • c69aa42: 8297968: Crash in PrintOptoAssembly
  • 5a5ced3: 8297830: aarch64: Make Address a discriminated union internally

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 1, 2022

@jddarcy Pushed as commit 770ff5a.

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

@jddarcy jddarcy deleted the JDK-8297215 branch June 10, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot-jfr hotspot-jfr-dev@openjdk.org integrated Pull request has been integrated net net-dev@openjdk.org serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

4 participants