[issue46716] regrtest didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x

Jeremy Kloth report at bugs.python.org
Sat Feb 12 23:29:46 EST 2022


Jeremy Kloth <jeremy.kloth+python-tracker at gmail.com> added the comment:

I've been able locally to reproduce the test_subprocess hang.  The responsible function is subprocess.run().  The test case, test_timeout(), uses a small timeout value (0.0001), which, when given enough load, can cause the run() call to hang.

A judicious use of prints in subprocess.py, reveals that the timeout passed to wait() ends up being negative.  That value, once cast to a DWORD, ultimately causes a very long wait (0xfffffff2, in my testing).

It does seem that only the Windows Popen._wait() cannot handle negative timeout values, so the fix should be as simple as coercing the timeout values to >= 0.

----------
Added file: https://bugs.python.org/file50623/process.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46716>
_______________________________________


More information about the Python-bugs-list mailing list