-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add a way to inherit ResourceLocks that allows for more parallel execution of tests #3102
Comments
Team decision: Introduce |
Defaults to SELF to preserve existing behavior. Using CHILDREN has the same effect as declaring @ResourceLock on every @test method of a test class. Issue: junit-team#3102
Defaults to SELF to preserve existing behavior. Using CHILDREN has the same effect as declaring @ResourceLock on every @test method of a test class. Issue: junit-team#3102
where the target defaults to `SELF` to preserve existing behavior. Using `CHILDREN` has the same effect as declaring @ResourceLock on every @test method of a test class. Issue: junit-team#3102
Using CHILDREN has the same effect as declaring @ResourceLock on every @test method of a test class. Issue: junit-team#3102
Using CHILDREN has the same effect as declaring @ResourceLock on every @test method of a test class. Issue: junit-team#3102
Defaults to SELF to preserve existing behavior. Using CHILDREN has the same effect as declaring @ResourceLock on every @test method of a test class. Issue: junit-team#3102
Hey @Squibbles, can you build locally the branch from PR #3220 to see if that brings any improvement? I soon realized my unit tests work insignificantly better (not that many of those I have to show some real boost) @marcphilipp I would appreciate your feedback too. |
@marcphilipp If the work is not currently in progress, I'd be happy to continue. Can I take it? |
@VladimirDmitrienko Yes, please go ahead! 👍 |
As seen in issue #2038 if a class level resource lock is specified, even if it is only a READ lock it will cause all tests that inherit it to run single threaded if any one of those tests uses a READ_WRITE lock. It was suggested in a comment by @leonard84 that it might be possible to add an annotation that would apply to a descriptor's children but not to the descriptor itself. This kind of functionality would be extremely useful in our project because we have 3000+ tests spread over hundreds of test classes. I would like to apply a READ lock to our commonly used resources in the inheritance chain rather than having to add individual resource locks on each of several thousand tests. However, if I do specify a class level/inherited lock of any kind it makes any class that inherits it run in SAME_THREAD mode if there is any READ_WRITE locks anywhere in the class.
In this below example the first two tests run in parallel and tests 3/4 run individually as expected. But if you uncomment the class level resource lock then all tests run individually. I would like there to be a way to specify that all of these tests have a READ lock on resource2 without having to add the lock individually to each test:
Deliverables
The text was updated successfully, but these errors were encountered: