-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement parallel executor service without ForkJoinPool
#5060
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
Implement parallel executor service without ForkJoinPool
#5060
Conversation
* More precise clock * Fixed width thread names * Abbreviated package names
To avoid race conditions with other workers that lead to stalling.
…on-custom-implementation
mpkorstanje
left a comment
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.
No more remarks. LGTM.
| } | ||
| if (!entriesRequiringResourceLocks.isEmpty()) { | ||
| // One entry at a time to avoid blocking too much | ||
| tryToStealWork(entriesRequiringResourceLocks.get(0), BlockingMode.BLOCKING); |
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.
Entries can be stolen by other workers so, this restarts scanning the queue from the beginning too early.
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.
Fixed e7791ae
mpkorstanje
left a comment
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.
Thought of something.
…on-custom-implementation
|
CI failing on 85ccf17 from |
This PR introduces a new implementation of
HierarchicalTestExecutorServicethat runs rests in parallel and has limited work stealing capabilities but is not based onForkJoinPool. It avoids its pitfalls (such as #3945) and #3108 but may require additional threads because its work stealing is limited to direct children. Contrary to theForkJoinPoolimplementation, the new executor service guarantees that no more thanparallelismtest nodes are executed in parallel.My intention is to initially ship this implementation as an opt-in feature (via the new
junit.jupiter.execution.parallel.executorconfiguration parameter) in 6.1, make it an opt-out feature in 6.2, and drop support for theForkJoinPool-based implementation in a later to-be-determined release.The PR is not yet finished but feedback is already welcome! If you use parallel test execution in your projects (or other test engines), it would be great if you could try out the new implementation and report your observations.
Resolves #3108.
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@APIannotations