-
-
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
@Isolated annotation doesn't work properly when @ResourceLock annotations are also used #2605
Comments
Tentatively slated for 5.8 M2 for team discussion |
@n-miles Thanks for reporting! This is indeed a bug. I'm working on a fix. |
marcphilipp
added a commit
that referenced
this issue
May 13, 2021
Prior to this commit, the global read lock was not acquired for test classes with `@ResourceLock` annotations causing `@Isolated` tests to run in parallel. Fixes #2605.
marcphilipp
added a commit
that referenced
this issue
May 13, 2021
Prior to this commit, the global read lock was not acquired for test classes with `@ResourceLock` annotations causing `@Isolated` tests to run in parallel. Fixes #2605.
marcphilipp
added a commit
that referenced
this issue
May 15, 2021
Prior to this commit, the global read lock was not acquired for test classes with `@ResourceLock` annotations causing `@Isolated` tests to run in parallel. Fixes #2605.
marcphilipp
added a commit
that referenced
this issue
May 15, 2021
Prior to this commit, the global read lock was not acquired for test classes with `@ResourceLock` annotations causing `@Isolated` tests to run in parallel. Fixes #2605.
runningcode
pushed a commit
to runningcode/junit5
that referenced
this issue
Feb 15, 2023
Prior to this commit, the global read lock was not acquired for test classes with `@ResourceLock` annotations causing `@Isolated` tests to run in parallel. Fixes junit-team#2605.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The documentaion for
@Isolated
statesThe
@Isolated
annotation is implemented as a global lock. At a glance, it looks like it's just shorthand forThis has a very surprising and I would argue buggy implication: if you use a
@ResourceLock("something")
annotation on one test and@Isolated
on another, the@Isolated
test will run in parallel with the@ResourceLock
ed test, violating the "no other test class is executed concurrently" part of the@Isolated
contract.Steps to reproduce
Put this in your
src/test/resources/junit-platform.properties
fileDefine 3 test classes like this in some package:
Expected Behavior
I expect none of these tests to interleave - The
@ResourceLock("something")
tests acquire the read-write lock, so they should not interleave with each other, and the@Isolated
test has the behavior that "no other test class is executed concurrently", so it should not interleave with either of the other tests.Actual Behavior
The
@Isolated
test runs in parallel with the@ResourceLock("something")
testsContext
junit-jupiter-api:5.7.1
The text was updated successfully, but these errors were encountered: