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
8272854: split runtime/CommandLine/PrintTouchedMethods.java test #5231
Conversation
|
public static void main(String args[]) throws Exception { | ||
var pid = Long.toString(ProcessHandle.current().pid()); | ||
var pb = new ProcessBuilder(); | ||
pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.print_touched_methods"}); |
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.
Can't you just include the desired VM flags as part of the String[] here and keep everything in one file and using driver mode?
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.
VM flags which we pass here are for jcmd
(that connects to the main process), but it's the main process that needs to be run w/ -XX:+UnlockDiagnosticVMOptions -XX:+LogTouchedMethods
.
we can keep all testing in one test file by introducing yet another process (which does nothing and just waits for the signal from the main process to exit) and pass its pid to jcmd
. IMHO, this will just add unneeded complexity to the test.
@iignatev 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! |
@iignatev 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 |
@iignatev This pull request is now open |
try { | ||
output.shouldContain("PrintTouchedMethodsJcmd.main:([Ljava/lang/String;)V"); | ||
} catch (RuntimeException e) { | ||
output.shouldContain("Unknown diagnostic command"); |
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.
I think this is an existing bug. Do we need this catch block? TouchedMethodsDCmd is always enabled as long as the current JVM has INCLUDE_SERVICES is true. If INCLUDE_SERVICES is false, the jcmd connection will fail, and you will get a different error, like
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/18810/root/tmp/.java_pid18810: target process 18810 doesn't respond within 10500ms or HotSpot VM not loaded
The catch block will incorrectly ignore the problem if the VM is incorrectly modified and the TouchedMethodsDCmd is inadvently excluded.
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.
I agree that it doesn't seem we need the catch block here. yet I'd prefer to remove it by a separate RFE.
@iignatev This change now passes all automated pre-integration checks. 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 740 new commits pushed to the
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.
|
/integrate |
Going to push as commit c94dc2a.
Your commit was automatically rebased without conflicts. |
Hi all,
could you please review this patch that extracts part of
runtime/CommandLine/PrintTouchedMethods.java
test toruntime/CommandLine/PrintTouchedMethodsJcmd.java
?from JBS:
testing:
runtime/CommandLine/
on{linux,windows,macos}-x64
-- Igor
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5231/head:pull/5231
$ git checkout pull/5231
Update a local copy of the PR:
$ git checkout pull/5231
$ git pull https://git.openjdk.java.net/jdk pull/5231/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5231
View PR using the GUI difftool:
$ git pr show -t 5231
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5231.diff