(proc)
| 95 | |
| 96 | |
| 97 | def quiesce(proc): |
| 98 | # Every spawned process is the leader of its own new session/group. Nested |
| 99 | # reducer tools inherit that group. C fixtures separately prove native reaps. |
| 100 | notes = [] |
| 101 | for sig in (signal.SIGTERM, signal.SIGKILL): |
| 102 | if proc.poll() is not None and not group_exists(proc.pid): |
| 103 | return True, notes |
| 104 | signal_group(proc.pid, sig) |
| 105 | notes.append("sent " + signal.Signals(sig).name) |
| 106 | until = time.monotonic() + GRACE |
| 107 | while time.monotonic() < until: |
| 108 | if proc.poll() is not None and not group_exists(proc.pid): |
| 109 | return True, notes |
| 110 | time.sleep(min(0.05, max(0, until - time.monotonic()))) |
| 111 | return proc.poll() is not None and not group_exists(proc.pid), notes |
| 112 | |
| 113 | |
| 114 | def run_process(directory, label, argv, environment): |
no test coverage detected