-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8320707: Virtual thread test updates #17136
Conversation
👋 Welcome back alanb! A progress list of the required criteria for merging this PR into |
@AlanBateman The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Can you explain your motivation for using AtomicBoolean with a polling loop rather than CountDownLatch(1)? I'm working on a test where I just added a CountDownLatch(1) and am wondering if I should do the same, but I'm not sure if there is something about these tests that is motivating the change. |
CountDownLatch is great for many tests. It's not as powerful as a Phaser of course but good enough and usually easy to understand quickly what is going on. However, for tests that are testing thread state then you often want to have as few dependencies as possible. In the case of CountDownlatch, the await method may park. The countDown method may have to unpark waiters for for virtual threads it means potentially parking (to queue a task) when unparking, so temporary transitions that JVMTI has to be concerned with. The other thing is keeping tests simple/consistent, it can be hard to maintain tests where one test method coordinates with one approach, another test method does something different. |
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.
Overall these changes look OK to me. I haven't paid much attention to the jvmti test change, but I've looked at others and they seem fine.
The StressStackOverflow
test has its duration reduced by half which appears intentional and then there's a new test library helper class to allow pinning tasks in tests.
Just one question - doesn't the use of a new native code in the test library (the libVThreadPinner.c
) require any build changes (I'm not too familiar with that part)?
@AlanBateman 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 25 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 |
Magnus did some work in the make files some time ago to build native libs in the test/lib tree. Thanks for reviewing. |
/integrate |
Going to push as commit b67b71c.
Your commit was automatically rebased without conflicts. |
@AlanBateman Pushed as commit b67b71c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
A lot of test changes have accumulated in the loom repo, this includes both new tests and updates to existing tests. Some of these updates can be brought to the main line. This update brings over:
The existing tests for pinning use synchronized blocks. In preparation for changes to allow carrier thread be released when a virtual thread parks holding a monitor or blocks on monitorenter, these tests are changed to pin by having a native frame on the stack. This part includes test infrastructure to make it easy to add more tests that do operations while pinned. The tests still test what they were originally created to test of course.
The test for the JFR jdk.VirtualThreadPinned event is refactored to allow for additional cases where the event may be reported.
ThreadAPI is expanded to cover test for uncaught exception handling.
GetStackTraceWhenRunnable is refactored to not use a Selector, otherwise this test will be invalidated when blocking selection operations release the carrier.
StressStackOverflow is dialed down to run for 1m instead of 2mins.
The use of CountDownLatch in a number of tests that poll thread state has been dropped to keep the tests as simple as possible.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17136/head:pull/17136
$ git checkout pull/17136
Update a local copy of the PR:
$ git checkout pull/17136
$ git pull https://git.openjdk.org/jdk.git pull/17136/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17136
View PR using the GUI difftool:
$ git pr show -t 17136
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17136.diff
Webrev
Link to Webrev Comment