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
8 changes: 8 additions & 0 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ System Partition Configuration
.. versionadded:: 4.10
The ``pbspro`` scheduler is added.

.. versionchanged:: 4.11
Tests whose Slurm job has expired are now skipped instead of failed.

.. note::
If a job submitted through the ``slurm`` backend ends up in the ``DEADLINE`` state, i.e., it did not start before the deadline set with ``--deadline``, the associated test will be skipped and not failed.
This applies to the ``slurm`` backend only;
the ``squeue`` backend does not treat expired jobs specially, because once the job is out of the queue, its state cannot be retrieved.

.. note::
The Slurm-based backends unset all ``SBATCH_*`` environment variables before submitting a job.
This is done to avoid environment variables bypassing ReFrame's configuration.
Expand Down
9 changes: 8 additions & 1 deletion reframe/core/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
from reframe.core.backends import register_scheduler
from reframe.core.exceptions import (SpawnedProcessError,
JobBlockedError,
JobSchedulerError)
JobSchedulerError,
SkipTestError)
from reframe.utility import nodelist_abbrev, seconds_to_hms


Expand Down Expand Up @@ -545,6 +546,12 @@ def poll(self, *jobs):
job._state = ','.join(m.group('state') for m in jobarr_info)

if slurm_state_completed(job.state):
# If the job has hit its DEADLINE, skip the test
if job.state == 'DEADLINE':
job._exception = SkipTestError(
f'the associated job {job.jobid} has expired'
)

# Since Slurm exitcodes are positive take the maximum one
job._exitcode = max(
int(m.group('exitcode')) for m in jobarr_info
Expand Down
Loading