Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Blanca-Fuentes committed Jan 15, 2025
1 parent 02ddcc2 commit 9d336c4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions reframe/core/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ def filternodes(self, job, nodes):
'''

@abc.abstractmethod
def submit(self, job):
async def submit(self, job):
'''Submit a job.
:arg job: A job descriptor.
:meta private:
'''

@abc.abstractmethod
def wait(self, job):
async def wait(self, job):
'''Wait for a job to finish.
:arg job: A job descriptor.
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}'
Expand Down
3 changes: 2 additions & 1 deletion reframe/frontend/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
JobNotStartedError,
FailureLimitError,
ForceExitError,
KeyboardError,
RunSessionTimeout,
SkipTestError,
StatisticsError,
TaskExit)
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)


Expand Down
4 changes: 2 additions & 2 deletions reframe/frontend/executors/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d336c4

Please sign in to comment.