Preserve docs-example body failures
Best-effort subprocess teardown must not replace the exception raised by the test body. Suppress cleanup errors only while propagating that active failure; keep raising teardown errors on normal body exit. Also close the Windows stdin pipe after its bounded leader reap. Review: PR #480 (goodboy) https://github.com/goodboy/tractor/pull/480 (this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))wkt/uds_macos_473
parent
340d506940
commit
bd38204fde
|
|
@ -48,6 +48,8 @@ def _reap_killed_proc(
|
||||||
return proc.communicate()
|
return proc.communicate()
|
||||||
|
|
||||||
proc.wait(timeout=5)
|
proc.wait(timeout=5)
|
||||||
|
if proc.stdin:
|
||||||
|
proc.stdin.close()
|
||||||
if proc.stdout:
|
if proc.stdout:
|
||||||
proc.stdout.close()
|
proc.stdout.close()
|
||||||
if proc.stderr:
|
if proc.stderr:
|
||||||
|
|
@ -257,7 +259,15 @@ def run_example_in_subproc(
|
||||||
assert not proc.returncode
|
assert not proc.returncode
|
||||||
try:
|
try:
|
||||||
yield proc
|
yield proc
|
||||||
finally:
|
except BaseException:
|
||||||
|
if proc.poll() is None:
|
||||||
|
try:
|
||||||
|
_kill_proc_tree(proc)
|
||||||
|
_reap_killed_proc(proc)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
raise
|
||||||
|
else:
|
||||||
if proc.poll() is None:
|
if proc.poll() is None:
|
||||||
_kill_proc_tree(proc)
|
_kill_proc_tree(proc)
|
||||||
_reap_killed_proc(proc)
|
_reap_killed_proc(proc)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue