Skip to content

Commit 69afc67

Browse files
author
Vasileios Karakasis
authored
Merge pull request #1434 from ekouts/bugfix/async_policy_loop
[bugfix] Capture all pending test tasks in the exit loop of the asynchronous execution policy
2 parents c027bc7 + 8f99238 commit 69afc67

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

reframe/frontend/executors/policies.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
import contextlib
7+
import functools
78
import itertools
89
import math
910
import sys
@@ -17,6 +18,10 @@
1718
TaskEventListener, ABORT_REASONS)
1819

1920

21+
def dictlist_len(d):
22+
return functools.reduce(lambda l, r: l + len(r), d.values(), 0)
23+
24+
2025
def _cleanup_all(tasks, *args, **kwargs):
2126
for task in tasks:
2227
if task.ref_count == 0:
@@ -416,7 +421,8 @@ def exit(self):
416421
pollrate = PollRateFunction(0.2, 60)
417422
num_polls = 0
418423
t_start = datetime.now()
419-
while (self._running_tasks or self._waiting_tasks):
424+
while (self._running_tasks or self._waiting_tasks or
425+
self._completed_tasks or dictlist_len(self._ready_tasks)):
420426
getlogger().debug('running tasks: %s' % len(self._running_tasks))
421427
num_polls += len(self._running_tasks)
422428
try:

0 commit comments

Comments
 (0)