7904149: jtreg fails when test with @enablePreview is executed with driver mode#314
7904149: jtreg fails when test with @enablePreview is executed with driver mode#314lmesnik wants to merge 6 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into |
|
@lmesnik 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: 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
Please see this link for an up-to-date comparison between the source branch of this pull request and the 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 (@sormuras) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Webrevs
|
sormuras
left a comment
There was a problem hiding this comment.
Thanks for updating the spec and faq documents.
Please also update the dates in the copyright headers and increase the version of the spec (as suggested).
src/share/classes/com/sun/javatest/regtest/exec/DriverAction.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Christian Stein <sormuras@gmail.com>
Co-authored-by: Christian Stein <sormuras@gmail.com>
Co-authored-by: Christian Stein <sormuras@gmail.com>
|
/integrate |
|
/sponsor |
|
While it may be too late to comment, it seems wrong to execute a driver class with preview features enabled. The original intent of "driver code" was to be able to use plain-simple-standard Java, instead of shell scripts, to properly execute the "real" test class, which should be executed on the test JVM, with any necessary options (like "enable preview") enabled. Instead of running driver-mode classes with "enable preview" enabled, surely it would be better to ensure the relevant classes were not compiled with "enable preview". |
|
Unlike shell code,, the driver code is not completely isolated from test code, and it's compiled with all the test compilation flags. So can't have combination of enablePreview + driver. It is going to fail because compiled with compilation flags and executed with not. Another case - we need to compile and run tests with '--enable-preview'. The '--enabe-preview' compilation should be completely compatible except few non-preview tests. (Remind that '--enable-preview' for valhalla affects compilation even if class is not value class itself.) Also, I think that we should more care real use cases and adopt our tools for our goals rather than change process and goals. |
|
Driver code is not test code. It is intended to be code that runs in a plain stable Java environment that sets up the environment for a test in a way that is beyond the normal simple abilities of If you want to run code in the test environment, use |
The test like this
fails in valhalla repo because class is compiled with enable-preview while executed without this option.
Test fails with:
java.lang.UnsupportedClassVersionError: Preview features are not enabled for PreviewDriverTest (class file version 71.65535). Try running with '--enable-preview'
It doesn't use any Valhalla feature directly but has a field Integer and javac generates additional attributes because of this.
Fix is just to pass --enable-preview to driver code.
The workaround is to don't run driver tests with enable preview.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jtreg.git pull/314/head:pull/314$ git checkout pull/314Update a local copy of the PR:
$ git checkout pull/314$ git pull https://git.openjdk.org/jtreg.git pull/314/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 314View PR using the GUI difftool:
$ git pr show -t 314Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/314.diff
Using Webrev
Link to Webrev Comment