(proc)
| 346 | |
| 347 | |
| 348 | def _quiesce(proc): |
| 349 | sent = [] |
| 350 | for sig in (signal.SIGTERM, signal.SIGKILL): |
| 351 | if proc.poll() is not None and not _group_exists(proc.pid): |
| 352 | return True, sent |
| 353 | try: |
| 354 | os.killpg(proc.pid, sig) |
| 355 | sent.append(signal.Signals(sig).name) |
| 356 | except ProcessLookupError: |
| 357 | pass |
| 358 | until = time.monotonic() + GRACE |
| 359 | while time.monotonic() < until: |
| 360 | if proc.poll() is not None and not _group_exists(proc.pid): |
| 361 | return True, sent |
| 362 | time.sleep(0.02) |
| 363 | return proc.poll() is not None and not _group_exists(proc.pid), sent |
| 364 | |
| 365 | |
| 366 | def _run(evidence, label, argv, environment, timeout, cwd, watch_raw=False): |
no test coverage detected