Skip to content

Commit bd24b6f

Browse files
committed
Simplify
1 parent b647f0b commit bd24b6f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,27 +293,18 @@ void processQueueEntries(WorkerLease workerLease, BooleanSupplier doneCondition)
293293

294294
private void processQueueEntries() {
295295
var entriesRequiringResourceLocks = new ArrayList<WorkQueue.Entry>();
296-
var queueModified = false;
297296

298297
for (var entry : workQueue) {
299298
var result = tryToStealWork(entry, BlockingMode.NON_BLOCKING);
300-
// After executing a test a significant amount of time has passed.
301-
// Process the queue from the beginning
302299
if (result == WorkStealResult.EXECUTED_BY_THIS_WORKER) {
300+
// After executing a test a significant amount of time has passed.
301+
// Process the queue from the beginning
303302
return;
304303
}
305-
if (result == WorkStealResult.EXECUTED_BY_DIFFERENT_WORKER) {
306-
queueModified = true;
307-
}
308304
if (result == WorkStealResult.RESOURCE_LOCK_UNAVAILABLE) {
309305
entriesRequiringResourceLocks.add(entry);
310306
}
311307
}
312-
// The queue changed while we looked at it.
313-
// Check from the start before processing any blocked items.
314-
if (queueModified) {
315-
return;
316-
}
317308
if (!entriesRequiringResourceLocks.isEmpty()) {
318309
// One entry at a time to avoid blocking too much
319310
tryToStealWork(entriesRequiringResourceLocks.get(0), BlockingMode.BLOCKING);

0 commit comments

Comments
 (0)