diff --git a/reframe/core/schedulers/__init__.py b/reframe/core/schedulers/__init__.py index 5809d12ec5..fb987245a7 100644 --- a/reframe/core/schedulers/__init__.py +++ b/reframe/core/schedulers/__init__.py @@ -17,7 +17,7 @@ import reframe.utility.typecheck as typ from reframe.core.exceptions import JobError, JobNotStartedError from reframe.core.launchers import JobLauncher -from reframe.core.logging import (getlogger, DEBUG2) +from reframe.core.logging import getlogger, DEBUG2 class JobScheduler(abc.ABC): diff --git a/reframe/core/schedulers/pbs.py b/reframe/core/schedulers/pbs.py index a5e4abeb30..bdd73282db 100644 --- a/reframe/core/schedulers/pbs.py +++ b/reframe/core/schedulers/pbs.py @@ -19,8 +19,7 @@ import reframe.core.schedulers as sched import reframe.utility.osext as osext from reframe.core.backends import register_scheduler -from reframe.core.config import settings -from reframe.core.exceptions import (JobError, JobSchedulerError) +from reframe.core.exceptions import JobError, JobSchedulerError from reframe.utility import seconds_to_hms @@ -263,7 +262,8 @@ def poll(self, *jobs): job.max_pending_time): if (time.time() - job.submit_time >= job.max_pending_time): self.cancel(job) - job._exception = JobError('maximum pending time exceeded') + job._exception = JobError('maximum pending time exceeded', + job.jobid) @register_scheduler('torque') diff --git a/reframe/core/schedulers/slurm.py b/reframe/core/schedulers/slurm.py index 7aa82507f9..6b74c0f7e2 100644 --- a/reframe/core/schedulers/slurm.py +++ b/reframe/core/schedulers/slurm.py @@ -11,7 +11,6 @@ from argparse import ArgumentParser from contextlib import suppress -import reframe.core.environments as env import reframe.core.runtime as rt import reframe.core.schedulers as sched import reframe.utility.osext as osext @@ -432,7 +431,8 @@ def _cancel_if_pending_too_long(self, job): if t_pending >= job.max_pending_time: self.log(f'maximum pending time for job exceeded; cancelling it') self.cancel(job) - job._exception = JobError('maximum pending time exceeded') + job._exception = JobError('maximum pending time exceeded', + job.jobid) def _cancel_if_blocked(self, job, reasons=None): if (job.is_cancelling or not slurm_state_pending(job.state)): @@ -490,7 +490,7 @@ def _do_cancel_if_blocked(self, job, reason_descr): if reason_details is not None: reason_msg += ', ' + reason_details - job._exception = JobBlockedError(reason_msg) + job._exception = JobBlockedError(reason_msg, job.jobid) def wait(self, job): # Quickly return in case we have finished already