Skip to content

Commit e82e3e5

Browse files
committed
Allow to specify a reason for @isolated
1 parent f93eda0 commit e82e3e5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,10 @@
3939
@Inherited
4040
@ResourceLock("org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY")
4141
public @interface Isolated {
42+
43+
/**
44+
* The reason this test class needs to run in isolation.
45+
*/
46+
String value() default "";
47+
4248
}

platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void canRunTestsIsolatedFromEachOtherAcrossClasses() {
244244
assertThat(events.stream().filter(event(test(), finishedWithFailure())::matches)).isEmpty();
245245
}
246246

247-
@Isolated
247+
@Isolated("testing")
248248
static class IsolatedTestCase {
249249
static AtomicInteger sharedResource;
250250
static CountDownLatch countDownLatch;

0 commit comments

Comments
 (0)