Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cancels entire series if there's a scheduler error #399

Merged
merged 7 commits into from
Apr 6, 2021
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. """
francinelapid marked this conversation as resolved.
Show resolved Hide resolved

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