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

Let mocked bkill support specific kill signal #7599

Merged
merged 1 commit into from
Apr 9, 2024
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
5 changes: 4 additions & 1 deletion tests/integration_tests/scheduler/bin/bkill.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

def get_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Kill jobs")
parser.add_argument(
"-s", "--signal", type=str, help="Which signal to send", default="SIGKILL"
)
parser.add_argument("jobids", type=str, nargs="+")
return parser

Expand All @@ -15,7 +18,7 @@ def main() -> None:
args = get_parser().parse_args()

jobdir = Path(os.getenv("PYTEST_TMP_PATH", ".")) / "mock_jobs"
killsignal = signal.SIGTERM
killsignal = getattr(signal, args.signal)
for jobid in args.jobids:
pidfile = jobdir / f"{jobid}.pid"
if not pidfile.exists():
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/scheduler/test_generic_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ async def finished(iens, returncode):
assert finished_called


@pytest.mark.timeout(50)
async def test_kill(driver, tmp_path):
os.chdir(tmp_path)
aborted_called = False
Expand Down
Loading