-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8304834: Fix wrapper insertion in TestScaffold.parseArgs(String args[]) #13170
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
Conversation
👋 Welcome back lmesnik! A progress list of the required criteria for merging this PR into |
Webrevs
|
Sorry I'm struggling a bit to see where the current parsing logic is failing. Can you given an example of a command-line that will get processed incorrectly? I'm not sure why the generic "if it starts with |
I've added comment with example from one of tests and expected result of parsing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. I was hoping it would fix more of the failing tests than it did. I get we'll need to take a closer look at them. Would be good to eventually diagnose the root cause of the failures and get bugs filed for each category of failure.
if (mainWrapper != null && !argInfo.targetAppCommandLine.isEmpty()) { | ||
argInfo.targetAppCommandLine = TestScaffold.class.getName() + ' ' | ||
+ mainWrapper + ' ' + argInfo.targetAppCommandLine; | ||
argInfo.targetVMArgs += "--enable-preview "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like previously we ignored main.wrapper
if not set to Virtual
, but with your chagnes we accept any setting. That's ok, but --enable-preview
is really on needed when set to Virtual
.
@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 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
The non Virtual modes are Kernel (should be Platform) and None. They are mostly used to find id test fail because of wrapper or virtual threads. Not used in testing. |
// Parse arguments, like java/j* tools command-line arguments | ||
// the first argument not-starting with '-' is treated as a classname | ||
// the other arguments are split to targetVMArgs targetAppCommandLine correspondingly | ||
// The example of args for line '@run driver Frames2Test -Xss4M' is '-Xss4M' 'Frames2Targ'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Frames2Test
a typo there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frames2Test is the name of test that uses additional command-line options. It is an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case did you mean:
'@run driver Frames2Test -Xss4M Frames2Targ'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the @run line contains only the test name and additional command-line options if needed, the target app class 'Frames2Targ' is not included. I have copy-pasted this example from
jdk/test/jdk/com/sun/jdi/Frames2Test.java
Line 34 in 0deb648
* @run driver Frames2Test -Xss4M |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is very confusing because the Frames2Targ
seems to appear out of nowhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I could update the comment, but it is basically how the all jdi tests work. The test adds target by itself after all command line arguments.
Sorry still not sure what you mean by that. Do you mean the
which seems perfectly fine. |
before the fix, the parse args incorrectly compos argInfo, putting all args into targetAppCommandLine, including VM args. So the result for |
Isn't the |
I haven't seen that -J-.. is used here in the args, all tests just use vm flags directly. I am not sure if updating tests is the correct option here. |
Well whomever wrote the original parsing code expected that VM args would be passed using -J AFAICS. And if handling of non -J VM args is currently broken (per this PR) then how are those other tests working? Also note that if a test tries to set the classpath without using the |
Also note that both the old code and the new code won't correctly deal with other VM options that take separate arguments like classpath does e.g |
Yes, you are right. The ability to process options is very limited. Probably would be better to get rid of setting VM flags using driver test parameters completely. Let me check if it could be implemented. |
I have updated parsing to don't accept -J which has been used in the one test only. Also improved parsing to recognize double-argument options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small nit but otherwise the new approach to parsing args now seems complete/consistent.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks
/integrate |
Going to push as commit bc15163.
Your commit was automatically rebased without conflicts. |
The TestScaffold incorrectly parse options, it should insert wrapper class between VM options and applications classame.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13170/head:pull/13170
$ git checkout pull/13170
Update a local copy of the PR:
$ git checkout pull/13170
$ git pull https://git.openjdk.org/jdk.git pull/13170/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13170
View PR using the GUI difftool:
$ git pr show -t 13170
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13170.diff
Webrev
Link to Webrev Comment