8355071: Fix nsk/jdi test to not require lookup of main thread in order to set the breakpoint used for communication#24768
8355071: Fix nsk/jdi test to not require lookup of main thread in order to set the breakpoint used for communication#24768plummercj wants to merge 18 commits intoopenjdk:masterfrom
Conversation
…ding the main thread
|
👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into |
|
@plummercj 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 60 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. ➡️ To integrate this PR with the above commit message to the |
|
@plummercj The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
The PR is related to JDK-8353955, which is attempting to no longer run all jdk/jdi tests with includevirtualthreads=y, allowing the default to be includevirtualthreads=n, and tests that require includevirtualthreads=y to explicitly specify that need. The changes in this PR will reduce the number of tests that need to specify includevirtualthreads=y from about 350 to about 180. It does not make the change to have the default be includevirtualthreads=n, which will be left for JDK-8353955 once all tests are either fixed to work with includevirtualthreads=n or specify the need for includevirtualthreads=y. The changes in this PR relate to a common pattern in the nsk/jdi tests: All tests that do this require includevirtualthreads=y because of the thread lookup. There is no need for mainThread in this code. null can be used instead for a global breakpoint. Once this is done, there is usually no need to run the test with includevirtualthreads=y, although in a few tests there are other calls to thread lookup API that result in the test still needing includevirtualthreads=y. I replaced the above code with a call to a new API in JDIBase: This represents the bulk of the changes in this CR. Some tests had other references to mainThread that then needed to be addressed. For most, the thread was already stored in bpEvent and could be fetched from there: |
sendaoYan
left a comment
There was a problem hiding this comment.
Should we update the copyright year from 2024 to 2025.
I plan on doing that after the reviews are done. Given the large number of files being changed, I thought it would be easier to review without the noise of copyright updates in nearly every file. |
Webrevs
|
lmesnik
left a comment
There was a problem hiding this comment.
Good to see more simplification of common code patterns.
See my small comment inline.
Also, you need to update a copyrights for changed files.
| breakpRequest = eventRManager.createBreakpointRequest(lineLocation); | ||
| breakpRequest.putProperty("number", property); | ||
| breakpRequest.addThreadFilter(thread); | ||
| if (thread != null) { |
There was a problem hiding this comment.
The change might hide failure if thread is not set in the test.
I would prefer to have
private settingBreakpoint(ThreadReference thread,.,.) that allows null
and
protected final BreakpointRequest settingBreakpoint(ThreadReference thread,
ReferenceType testedClass,
String methodName,
String bpLine,
String property)
that still fails early if thread is null. (I think now it should fail in
breakpRequest.addThreadFilter(thread);
string.
So for any test that don't have proper thread - test fails early when setting breakpoint and not because it hasn't find it.
There was a problem hiding this comment.
Ok. I updated to use a different API that implies no thread.
|
Thank you for the reviews Leonid and Alex! /integrate |
|
Going to push as commit b7e8952.
Your commit was automatically rebased without conflicts. |
|
@plummercj Pushed as commit b7e8952. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Remove the need for many nsk/jdi tests to discover the main thread, resulting in the test needing to be run with includevirtualthreads=y. Details in first comment.
Tested with all tier2, tier3, and tier5 svc tests
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24768/head:pull/24768$ git checkout pull/24768Update a local copy of the PR:
$ git checkout pull/24768$ git pull https://git.openjdk.org/jdk.git pull/24768/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24768View PR using the GUI difftool:
$ git pr show -t 24768Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24768.diff
Using Webrev
Link to Webrev Comment