Skip to content

Commit 82fa0c6

Browse files
mpkorstanjemarcphilipp
authored andcommitted
Use long index, because containers are int size
1 parent fb8d9b4 commit 82fa0c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ConcurrentHierarchicalTestExecutorService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import java.util.concurrent.ThreadFactory;
4040
import java.util.concurrent.ThreadPoolExecutor;
4141
import java.util.concurrent.atomic.AtomicInteger;
42+
import java.util.concurrent.atomic.AtomicLong;
4243
import java.util.function.BiFunction;
4344
import java.util.function.BooleanSupplier;
4445
import java.util.function.Consumer;
@@ -537,7 +538,7 @@ private enum BlockingMode {
537538
}
538539

539540
private static class WorkQueue implements Iterable<WorkQueue.Entry> {
540-
private final AtomicInteger index = new AtomicInteger();
541+
private final AtomicLong index = new AtomicLong();
541542
private final Set<Entry> queue = new ConcurrentSkipListSet<>();
542543

543544
Entry add(TestTask task) {
@@ -581,7 +582,7 @@ public Iterator<Entry> iterator() {
581582
return queue.iterator();
582583
}
583584

584-
private record Entry(TestTask task, CompletableFuture<@Nullable Void> future, int level, int index)
585+
private record Entry(TestTask task, CompletableFuture<@Nullable Void> future, int level, long index)
585586
implements Comparable<Entry> {
586587

587588
@SuppressWarnings("FutureReturnValueIgnored")
@@ -606,7 +607,7 @@ public int compareTo(Entry that) {
606607
if (result != 0) {
607608
return result;
608609
}
609-
return Integer.compare(that.index, this.index);
610+
return Long.compare(that.index, this.index);
610611
}
611612

612613
private boolean isContainer() {

0 commit comments

Comments
 (0)