Skip to content

Allow declaring exclusive resources for child nodes#4151

Merged
marcphilipp merged 4 commits intojunit-team:mainfrom
vdmitrienko:#3102_allow_to_inherit_resource_locks
Nov 26, 2024
Merged

Allow declaring exclusive resources for child nodes#4151
marcphilipp merged 4 commits intojunit-team:mainfrom
vdmitrienko:#3102_allow_to_inherit_resource_locks

Conversation

@vdmitrienko
Copy link
Copy Markdown
Contributor

@vdmitrienko vdmitrienko commented Nov 23, 2024

Issue: #3102

Overview

Allow declaring "shared resources" for direct child nodes via the new @ResourceLock(target = CHILDREN) attribute.

Using the @ResourceLock(target = CHILDREN) in a class-level annotation has the same semantics as adding an annotation with the same value and mode to each test method and nested test class declared in this class.

This may improve parallelization when a test class declares a READ lock, but only a few methods hold a READ_WRITE lock.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

Copy link
Copy Markdown
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I only found some minor things.

Comment thread documentation/src/docs/asciidoc/user-guide/writing-tests.adoc Outdated
Comment thread documentation/src/docs/asciidoc/user-guide/writing-tests.adoc Outdated
Comment thread documentation/src/docs/asciidoc/user-guide/writing-tests.adoc Outdated
Comment thread documentation/src/docs/asciidoc/user-guide/writing-tests.adoc Outdated
@vdmitrienko
Copy link
Copy Markdown
Contributor Author

Looks good! I only found some minor things.

@marcphilipp thanks for the review 🙂

Updated according to the comments

Comment thread documentation/src/docs/asciidoc/user-guide/writing-tests.adoc Outdated
@marcphilipp marcphilipp merged commit af6b502 into junit-team:main Nov 26, 2024
@marcphilipp
Copy link
Copy Markdown
Member

Thank you for your contribution, @vdmitrienko! 👍

After merging, I noticed that the tests were in the wrong package/project so I moved them in c1a976e.

@vdmitrienko vdmitrienko deleted the #3102_allow_to_inherit_resource_locks branch November 26, 2024 09:16
@vdmitrienko
Copy link
Copy Markdown
Contributor Author

Thank you for your contribution, @vdmitrienko! 👍

My pleasure!

After merging, I noticed that the tests were in the wrong package/project so I moved them in c1a976e.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to inherit ResourceLocks that allows for more parallel execution of tests

3 participants