diff --git a/reframe/core/schedulers/__init__.py b/reframe/core/schedulers/__init__.py index a74f57932..b44df5538 100644 --- a/reframe/core/schedulers/__init__.py +++ b/reframe/core/schedulers/__init__.py @@ -101,7 +101,7 @@ def filternodes(self, job, nodes): ''' @abc.abstractmethod - def submit(self, job): + async def submit(self, job): '''Submit a job. :arg job: A job descriptor. @@ -109,7 +109,7 @@ def submit(self, job): ''' @abc.abstractmethod - def wait(self, job): + async def wait(self, job): '''Wait for a job to finish. :arg job: A job descriptor. @@ -136,7 +136,7 @@ def finished(self, job): ''' @abc.abstractmethod - def poll(self, *jobs): + async def poll(self, *jobs): '''Poll all the requested jobs. :arg jobs: The job descriptors to poll. diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 8bc4cf06e..c51e7050d 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -1745,7 +1745,8 @@ def module_unuse(*paths): sys.exit(1) else: sys.exit(0) - except (Exception, KeyboardInterrupt, errors.ReframeFatalError): + except (Exception, KeyboardInterrupt, errors.KeyboardError, + errors.ReframeFatalError): exc_info = sys.exc_info() tb = ''.join(traceback.format_exception(*exc_info)) message = f'run session stopped: {errors.what(*exc_info)}' diff --git a/reframe/frontend/executors/__init__.py b/reframe/frontend/executors/__init__.py index 68466ce98..5f5d7dfb1 100644 --- a/reframe/frontend/executors/__init__.py +++ b/reframe/frontend/executors/__init__.py @@ -24,6 +24,7 @@ JobNotStartedError, FailureLimitError, ForceExitError, + KeyboardError, RunSessionTimeout, SkipTestError, StatisticsError, @@ -31,7 +32,7 @@ from reframe.core.schedulers.local import LocalJobScheduler from reframe.frontend.printer import PrettyPrinter -ABORT_REASONS = (AssertionError, FailureLimitError, +ABORT_REASONS = (AssertionError, FailureLimitError, KeyboardError, KeyboardInterrupt, ForceExitError, RunSessionTimeout) diff --git a/reframe/frontend/executors/policies.py b/reframe/frontend/executors/policies.py index 6fda6b31a..af46e55d2 100644 --- a/reframe/frontend/executors/policies.py +++ b/reframe/frontend/executors/policies.py @@ -309,7 +309,7 @@ def execute(self, testcases): try: loop.run_until_complete(self._runcase(case)) except (Exception, KeyboardInterrupt) as e: - if type(e) in ABORT_REASONS or isinstance(e, KeyboardError): + if type(e) in ABORT_REASONS: for task in all_tasks(loop): if isinstance(task, asyncio.tasks.Task): task.cancel() @@ -684,7 +684,7 @@ def execute(self, testcases): # Wait for tasks until the first failure loop.run_until_complete(self._execute_until_failure(all_cases)) except (Exception, KeyboardInterrupt) as e: - if type(e) in ABORT_REASONS or isinstance(e, KeyboardError): + if type(e) in ABORT_REASONS: loop.run_until_complete(_cancel_gracefully(all_cases)) try: raise AbortTaskError