Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reframe/frontend/executors/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def run_check(self, check, partition, environ):

except TaskExit:
return
except ABORT_REASONS:
task.fail(sys.exc_info())
except ABORT_REASONS as e:
task.abort(e)
raise
except BaseException:
task.fail(sys.exc_info())
Expand Down
5 changes: 5 additions & 0 deletions reframe/frontend/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ def __init__(self, tasks=[]):
def __repr__(self):
return debug.repr(self)

def alltasks(self):
for tlist in self._tasks_bypart.values():
for t in tlist:
yield t

def num_failures(self, partition=None):
num_fails = 0
if partition:
Expand Down
13 changes: 13 additions & 0 deletions unittests/test_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import reframe.frontend.executors as executors
import reframe.frontend.executors.policies as policies
from reframe.core.exceptions import JobNotStartedError
from reframe.core.modules import init_modules_system
from reframe.frontend.loader import RegressionCheckLoader, SiteConfiguration
from reframe.frontend.resources import ResourcesManager
Expand Down Expand Up @@ -34,6 +35,16 @@ def setUp(self):
def tearDown(self):
shutil.rmtree(self.resourcesdir, ignore_errors=True)

def assert_all_dead(self):
stats = self.runner.stats
for t in self.runner.stats.alltasks():
try:
finished = t.check.poll()
except JobNotStartedError:
finished = True

self.assertTrue(finished)

def test_runall(self):
self.runner.runall(self.checks, self.system)

Expand Down Expand Up @@ -106,6 +117,7 @@ def test_kbd_interrupt_within_test(self):
[check], self.system)
stats = self.runner.stats
self.assertEqual(1, stats.num_failures())
self.assert_all_dead()

def test_system_exit_within_test(self):
check = SystemExitCheck(system=self.system, resources=self.resources)
Expand Down Expand Up @@ -287,6 +299,7 @@ def _run_checks(self, checks, max_jobs):

self.assertEqual(4, self.runner.stats.num_cases())
self.assertEqual(4, self.runner.stats.num_failures())
self.assert_all_dead()

def test_kbd_interrupt_in_wait_with_concurrency(self):
checks = [
Expand Down