Skip to content

Commit

Permalink
cancels entire series if there's a scheduler error
Browse files Browse the repository at this point in the history
  • Loading branch information
francinelapid committed Mar 16, 2021
1 parent 6ff1dd4 commit 5bf019d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/pavilion/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def run_tests(self, wait: Union[None, int] = None,
fprint(err, bullet=' ', file=self.errfile)
fprint('Cancelling already kicked off tests.',
file=self.errfile)
sched.cancel_job(test)
self.cancel_series(by_sigterm=False)
return errno.EINVAL

# Tests should all be scheduled now, and have the SCHEDULED state
Expand Down Expand Up @@ -682,15 +682,16 @@ def create_set_graph(self):

return

def cancel_series(self):
def cancel_series(self, by_sigterm=True):
"""Goes through all test objects assigned to series and cancels tests
that haven't been completed. """

for test_id, test_obj in self.tests.items():
if not (test_obj.path/'RUN_COMPLETE').exists():
sched = schedulers.get_plugin(test_obj.scheduler)
sched.cancel_job(test_obj)
test_obj.status.set(STATES.COMPLETE, "Killed by SIGTERM.")
if by_sigterm:
test_obj.status.set(STATES.COMPLETE, "Killed by SIGTERM.")
test_obj.set_run_complete()

def run_series(self):
Expand Down

0 comments on commit 5bf019d

Please sign in to comment.