Introduce global default lock to facilitate isolated test execution#2382
Merged
Conversation
This commit introduces a new global resource lock "__global__" that all test descriptors that are children of the engine descriptor acquire by default in READ mode. Using the `@Isolated` annotation in the Jupiter API causes the mode to be changed to READ_WRITE. Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
Codecov Report
@@ Coverage Diff @@
## main #2382 +/- ##
=========================================
Coverage 89.84% 89.84%
- Complexity 4533 4542 +9
=========================================
Files 397 397
Lines 11211 11233 +22
Branches 909 908 -1
=========================================
+ Hits 10072 10092 +20
- Misses 863 864 +1
- Partials 276 277 +1
Continue to review full report at Codecov.
|
marcphilipp
commented
Aug 13, 2020
marcphilipp
commented
Aug 13, 2020
marcphilipp
commented
Aug 14, 2020
marcphilipp
commented
Aug 14, 2020
leonard84
reviewed
Aug 15, 2020
leonard84
approved these changes
Aug 15, 2020
leonard84
approved these changes
Aug 15, 2020
vlsi
reviewed
Aug 15, 2020
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Target(ElementType.TYPE) | ||
| @Inherited | ||
| @ResourceLock("org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY") |
Contributor
There was a problem hiding this comment.
I wonder if the constant could be declared in the interface, so it could be referenced from ExclusiveResource
Member
Author
There was a problem hiding this comment.
jupiter-api doesn't have a dependency on platform-engine or vice versa.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a new global resource lock "global" that all
test descriptors that are children of the engine descriptor acquire by
default in READ mode. Using the
@Isolatedannotation in the JupiterAPI causes the mode to be changed to READ_WRITE.
Will eventually resolve #2142.
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@Isolatedon test classes and in@Nestedtests@APIannotations