Skip to content

Commit e81d757

Browse files
committed
Use long index, because containers are int size
1 parent 656fcf4 commit e81d757

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;
@@ -538,7 +539,7 @@ private enum BlockingMode {
538539
}
539540

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

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

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

588589
@SuppressWarnings("FutureReturnValueIgnored")
@@ -607,7 +608,7 @@ public int compareTo(Entry that) {
607608
if (result != 0) {
608609
return result;
609610
}
610-
return Integer.compare(that.index, this.index);
611+
return Long.compare(that.index, this.index);
611612
}
612613

613614
private boolean isContainer() {

0 commit comments

Comments
 (0)