6161 */
6262@ SuppressWarnings ("resource" )
6363@ Timeout (5 )
64- class ConcurrentHierarchicalTestExecutorServiceTests {
64+ class WorkerThreadPoolHierarchicalTestExecutorServiceTests {
6565
6666 @ AutoClose
6767 @ Nullable
68- ConcurrentHierarchicalTestExecutorService service ;
68+ WorkerThreadPoolHierarchicalTestExecutorService service ;
6969
7070 @ ParameterizedTest
7171 @ EnumSource (ExecutionMode .class )
@@ -75,7 +75,7 @@ void executesSingleTask(ExecutionMode executionMode) throws Exception {
7575
7676 var customClassLoader = new URLClassLoader (new URL [0 ], this .getClass ().getClassLoader ());
7777 try (customClassLoader ) {
78- service = new ConcurrentHierarchicalTestExecutorService (configuration (1 ), customClassLoader );
78+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (1 ), customClassLoader );
7979 service .submit (task ).get ();
8080 }
8181
@@ -90,7 +90,7 @@ void executesSingleTask(ExecutionMode executionMode) throws Exception {
9090 @ Test
9191 void invokeAllMustBeExecutedFromWithinThreadPool () {
9292 var tasks = List .of (new TestTaskStub (ExecutionMode .CONCURRENT ));
93- service = new ConcurrentHierarchicalTestExecutorService (configuration (1 ));
93+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (1 ));
9494
9595 assertPreconditionViolationFor (() -> requiredService ().invokeAll (tasks )) //
9696 .withMessage ("invokeAll() must be called from a worker thread that belongs to this executor" );
@@ -100,7 +100,7 @@ void invokeAllMustBeExecutedFromWithinThreadPool() {
100100 @ EnumSource (ExecutionMode .class )
101101 void executesSingleChildInSameThreadRegardlessOfItsExecutionMode (ExecutionMode childExecutionMode )
102102 throws Exception {
103- service = new ConcurrentHierarchicalTestExecutorService (configuration (1 ));
103+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (1 ));
104104
105105 var child = new TestTaskStub (childExecutionMode );
106106 var root = new TestTaskStub (ExecutionMode .CONCURRENT , () -> requiredService ().invokeAll (List .of (child )));
@@ -116,7 +116,7 @@ void executesSingleChildInSameThreadRegardlessOfItsExecutionMode(ExecutionMode c
116116
117117 @ Test
118118 void executesTwoChildrenConcurrently () throws Exception {
119- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 ));
119+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 ));
120120
121121 var latch = new CountDownLatch (2 );
122122 Executable behavior = () -> {
@@ -136,7 +136,7 @@ void executesTwoChildrenConcurrently() throws Exception {
136136
137137 @ Test
138138 void executesTwoChildrenInSameThread () throws Exception {
139- service = new ConcurrentHierarchicalTestExecutorService (configuration (1 ));
139+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (1 ));
140140
141141 var children = List .of (new TestTaskStub (ExecutionMode .SAME_THREAD ),
142142 new TestTaskStub (ExecutionMode .SAME_THREAD ));
@@ -158,7 +158,7 @@ void acquiresResourceLockForRootTask() throws Exception {
158158
159159 var task = new TestTaskStub (ExecutionMode .CONCURRENT ).withResourceLock (resourceLock );
160160
161- service = new ConcurrentHierarchicalTestExecutorService (configuration (1 ));
161+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (1 ));
162162 service .submit (task ).get ();
163163
164164 task .assertExecutedSuccessfully ();
@@ -171,7 +171,7 @@ void acquiresResourceLockForRootTask() throws Exception {
171171
172172 @ Test
173173 void acquiresResourceLockForChildTasks () throws Exception {
174- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 ));
174+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 ));
175175
176176 var resourceLock = mock (ResourceLock .class );
177177 when (resourceLock .tryAcquire ()).thenReturn (true , false );
@@ -198,7 +198,7 @@ void acquiresResourceLockForChildTasks() throws Exception {
198198
199199 @ Test
200200 void runsTasksWithoutConflictingLocksConcurrently () throws Exception {
201- service = new ConcurrentHierarchicalTestExecutorService (configuration (3 ));
201+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (3 ));
202202
203203 var resourceLock = new SingleLock (exclusiveResource (LockMode .READ_WRITE ), new ReentrantLock ());
204204
@@ -228,7 +228,7 @@ void runsTasksWithoutConflictingLocksConcurrently() throws Exception {
228228
229229 @ Test
230230 void processingQueueEntriesSkipsOverUnavailableResources () throws Exception {
231- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 ));
231+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 ));
232232
233233 var resourceLock = new SingleLock (exclusiveResource (LockMode .READ_WRITE ), new ReentrantLock ());
234234
@@ -265,7 +265,7 @@ void processingQueueEntriesSkipsOverUnavailableResources() throws Exception {
265265
266266 @ Test
267267 void invokeAllQueueEntriesSkipsOverUnavailableResources () throws Exception {
268- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 ));
268+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 ));
269269
270270 var resourceLock = new SingleLock (exclusiveResource (LockMode .READ_WRITE ), new ReentrantLock ());
271271
@@ -302,7 +302,7 @@ void invokeAllQueueEntriesSkipsOverUnavailableResources() throws Exception {
302302
303303 @ Test
304304 void prioritizesChildrenOfStartedContainers () throws Exception {
305- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 ));
305+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 ));
306306
307307 var leavesStarted = new CountDownLatch (2 );
308308
@@ -331,7 +331,7 @@ void prioritizesChildrenOfStartedContainers() throws Exception {
331331
332332 @ Test
333333 void prioritizesTestsOverContainers () throws Exception {
334- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 ));
334+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 ));
335335
336336 var leavesStarted = new CountDownLatch (2 );
337337 var leaf = new TestTaskStub (ExecutionMode .CONCURRENT , leavesStarted ::countDown ) //
@@ -358,7 +358,7 @@ void prioritizesTestsOverContainers() throws Exception {
358358
359359 @ RepeatedTest (value = 100 , failureThreshold = 1 )
360360 void limitsWorkerThreadsToMaxPoolSize () throws Exception {
361- service = new ConcurrentHierarchicalTestExecutorService (configuration (3 , 3 ));
361+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (3 , 3 ));
362362
363363 CountDownLatch latch = new CountDownLatch (3 );
364364 Executable behavior = () -> {
@@ -397,7 +397,7 @@ void limitsWorkerThreadsToMaxPoolSize() throws Exception {
397397
398398 @ Test
399399 void stealsBlockingChildren () throws Exception {
400- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 , 2 ));
400+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 , 2 ));
401401
402402 var child1Started = new CountDownLatch (1 );
403403 var leaf2aStarted = new CountDownLatch (1 );
@@ -449,7 +449,7 @@ public void release() {
449449
450450 @ RepeatedTest (value = 100 , failureThreshold = 1 )
451451 void executesChildrenInOrder () throws Exception {
452- service = new ConcurrentHierarchicalTestExecutorService (configuration (1 , 1 ));
452+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (1 , 1 ));
453453
454454 var leaf1a = new TestTaskStub (ExecutionMode .CONCURRENT ) //
455455 .withName ("leaf1a" ).withLevel (2 );
@@ -476,7 +476,7 @@ void executesChildrenInOrder() throws Exception {
476476
477477 @ RepeatedTest (value = 100 , failureThreshold = 1 )
478478 void workIsStolenInReverseOrder () throws Exception {
479- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 , 2 ));
479+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 , 2 ));
480480
481481 // Execute tasks pairwise
482482 CyclicBarrier cyclicBarrier = new CyclicBarrier (2 );
@@ -527,7 +527,7 @@ void workIsStolenInReverseOrder() throws Exception {
527527
528528 @ RepeatedTest (value = 100 , failureThreshold = 1 )
529529 void stealsDynamicChildren () throws Exception {
530- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 , 2 ));
530+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 , 2 ));
531531
532532 var child1Started = new CountDownLatch (1 );
533533 var child2Finished = new CountDownLatch (1 );
@@ -557,7 +557,7 @@ void stealsDynamicChildren() throws Exception {
557557
558558 @ RepeatedTest (value = 100 , failureThreshold = 1 )
559559 void stealsNestedDynamicChildren () throws Exception {
560- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 , 2 ));
560+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 , 2 ));
561561
562562 var barrier = new CyclicBarrier (2 );
563563
@@ -612,7 +612,7 @@ void stealsNestedDynamicChildren() throws Exception {
612612
613613 @ RepeatedTest (value = 100 , failureThreshold = 1 )
614614 void stealsSiblingDynamicChildrenOnly () throws Exception {
615- service = new ConcurrentHierarchicalTestExecutorService (configuration (2 , 3 ));
615+ service = new WorkerThreadPoolHierarchicalTestExecutorService (configuration (2 , 3 ));
616616
617617 var child1Started = new CountDownLatch (1 );
618618 var child2Started = new CountDownLatch (1 );
@@ -667,7 +667,7 @@ private static ExclusiveResource exclusiveResource(LockMode lockMode) {
667667 return new ExclusiveResource ("key" , lockMode );
668668 }
669669
670- private ConcurrentHierarchicalTestExecutorService requiredService () {
670+ private WorkerThreadPoolHierarchicalTestExecutorService requiredService () {
671671 return requireNonNull (service );
672672 }
673673
0 commit comments