Skip to content

Commit 06418ca

Browse files
committed
Fix prioritizesChildrenOfStartedContainers by swapping order
1 parent 09b5d1c commit 06418ca

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,14 @@ void prioritizesChildrenOfStartedContainers() throws Exception {
232232
service = new ConcurrentHierarchicalTestExecutorService(configuration(2));
233233

234234
var leavesStarted = new CountDownLatch(2);
235-
var leaf = new TestTaskStub(ExecutionMode.CONCURRENT, leavesStarted::countDown) //
236-
.withName("leaf").withLevel(3);
237-
var child1 = new TestTaskStub(ExecutionMode.CONCURRENT, () -> requiredService().submit(leaf).get()) //
235+
236+
var child1 = new TestTaskStub(ExecutionMode.CONCURRENT, leavesStarted::await) //
238237
.withName("child1").withLevel(2);
239238
var child2 = new TestTaskStub(ExecutionMode.CONCURRENT, leavesStarted::countDown) //
240239
.withName("child2").withLevel(2);
241-
var child3 = new TestTaskStub(ExecutionMode.SAME_THREAD, leavesStarted::await) //
240+
var leaf = new TestTaskStub(ExecutionMode.CONCURRENT, leavesStarted::countDown) //
241+
.withName("leaf").withLevel(3);
242+
var child3 = new TestTaskStub(ExecutionMode.CONCURRENT, () -> requiredService().submit(leaf).get()) //
242243
.withName("child3").withLevel(2);
243244

244245
var root = new TestTaskStub(ExecutionMode.SAME_THREAD,
@@ -248,11 +249,11 @@ void prioritizesChildrenOfStartedContainers() throws Exception {
248249
service.submit(root).get();
249250

250251
root.assertExecutedSuccessfully();
251-
assertThat(List.of(child1, child2, child3)).allSatisfy(TestTaskStub::assertExecutedSuccessfully);
252+
assertThat(List.of(child1, child2, leaf, child3)).allSatisfy(TestTaskStub::assertExecutedSuccessfully);
252253
leaf.assertExecutedSuccessfully();
253254

254255
assertThat(leaf.startTime).isBeforeOrEqualTo(child2.startTime);
255-
assertThat(leaf.executionThread).isSameAs(child1.executionThread);
256+
assertThat(leaf.executionThread).isSameAs(child3.executionThread);
256257
}
257258

258259
@Test

0 commit comments

Comments
 (0)