(self, worker_id: int, signal: int = signal.SIGTERM, wait=True)
| 259 | self.kill_process("server") |
| 260 | |
| 261 | def kill_worker(self, worker_id: int, signal: int = signal.SIGTERM, wait=True): |
| 262 | table = self.command(["worker", "info", str(worker_id)], as_table=True) |
| 263 | pid = table.get_row_value("Process pid") |
| 264 | process = self.find_process_by_pid(int(pid)) |
| 265 | if process is None: |
| 266 | raise Exception(f"Worker {worker_id} not found") |
| 267 | |
| 268 | process = self.kill_process(process.name, signal=signal) |
| 269 | if wait: |
| 270 | wait_until(lambda: process.poll() is not None) |
| 271 | |
| 272 | def find_process_by_pid(self, pid: int) -> Optional[ManagedProcess]: |
| 273 | for p in self.processes: |
no test coverage detected