diff --git a/torchx/runner/test/api_test.py b/torchx/runner/test/api_test.py index 49b9335ab..616987b04 100644 --- a/torchx/runner/test/api_test.py +++ b/torchx/runner/test/api_test.py @@ -153,6 +153,7 @@ def test_empty_session_id(self, _: MagicMock) -> None: ) app_handle = runner.run(app, "local", self.cfg) + runner.wait(app_handle, wait_interval=0.1) scheduler, session_name, app_id = parse_app_handle(app_handle) self.assertEqual(scheduler, "local") diff --git a/torchx/schedulers/local_scheduler.py b/torchx/schedulers/local_scheduler.py index 9250ee72a..aa5f63bf5 100644 --- a/torchx/schedulers/local_scheduler.py +++ b/torchx/schedulers/local_scheduler.py @@ -311,7 +311,7 @@ def terminate(self) -> None: """ # safe to call terminate on a process that already died try: - os.killpg(self.proc.pid, signal.SIGTERM) + os.kill(self.proc.pid, signal.SIGTERM) except ProcessLookupError as e: log.debug(f"Process {self.proc.pid} already got terminated")