Review of #9920 (thanks, Gevroska): on Windows a grandchild that inherits the
launcher's stdout/stderr pipes kept the check waiting past RUNNER_TIMEOUT,
on main and with the bounded communicate(), because leaving the Popen
context manager joins the pipe reader threads, which wait for every holder
of the pipes.
run_fixture no longer uses pipes: the output goes to two temporary files and
the run waits for the launcher alone, so no read can wait for a child. On a
timeout kill_tree() stops the process group on POSIX (as before) or the
process tree with taskkill /F /T on Windows, then the launcher is killed and
reaped with a bound. The files are read back as the pipes gave the text
(UTF-8 with replacements, \n line ends).
tests/test_check_d3d12_trace.py gains the reviewer's case: a launcher whose
child inherits its output and sleeps 30 s while the launcher sleeps 60 s,
with a 2 s limit; the check must fail with the one-line message within 15 s.
Not run here.
(cherry picked from commit cc2e281959)
Through a runner such as Wine, subprocess.run(timeout=120) killed only the
launcher; the fixture kept running and, holding the output pipes, kept the
check waiting past its limit. On POSIX with a runner, start the run in a
session of its own, kill the group on timeout, and fail with one line.