| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Letting Process.wait() only wait on actual process return is closer to how it's documented and consistent with Popen.wait(). This also reduces complexity for waking waiters which was inconsistend depending on ordering of wait/exit.
This allows waiters to be scheduled after protocol.process_exited and/or connection_lost callbacks.
|
I simplified the added test and also fixed it, now it correctly fails on main branch but passes on this. here's the failure on windows: ======================================================================
ERROR: test_wait_even_if_pipe_is_open (test.test_asyncio.test_subprocess.SubprocessProactorTests.test_wait_even_if_pipe_is_open)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\cpython\Lib\asyncio\tasks.py", line 488, in wait_for
return await fut
^^^^^^^^^
File "D:\cpython\Lib\asyncio\subprocess.py", line 137, in wait
return await self._transport._wait()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\cpython\Lib\asyncio\base_subprocess.py", line 255, in _wait
return await waiter
^^^^^^^^^^^^
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\cpython\Lib\test\test_asyncio\test_subprocess.py", line 446, in test_wait_even_if_pipe_is_open
self.loop.run_until_complete(run())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "D:\cpython\Lib\asyncio\base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "D:\cpython\Lib\test\test_asyncio\test_subprocess.py", line 436, in run
returncode = await asyncio.wait_for(
^^^^^^^^^^^^^^^^^^^^^^^
wait_proc, timeout=support.SHORT_TIMEOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\cpython\Lib\asyncio\tasks.py", line 487, in wait_for
async with timeouts.timeout(timeout):
~~~~~~~~~~~~~~~~^^^^^^^^^
File "D:\cpython\Lib\asyncio\timeouts.py", line 115, in __aexit__
raise TimeoutError from exc_val
TimeoutError
----------------------------------------------------------------------
Ran 41 tests in 35.871s |
Sorry, something went wrong.
|
Thanks @tapetersen for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
Sorry, something went wrong.
|
GH-154170 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
GH-154171 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-154172 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
@kumaraditya303 Thanks for the review and windows fix. |
Sorry, something went wrong.
… and not wait for closing of pipes (pythonGH-151983) (cherry picked from commit f252132) Co-authored-by: Tobias Alex-Petersen <tobias.alex.petersen@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…t and not wait for closing of pipes (GH-151983) (#154172) gh-119710: fix asyncio Process.wait() to finish on process exit and not wait for closing of pipes (GH-151983) (cherry picked from commit f252132) Co-authored-by: Tobias Alex-Petersen <tobias.alex.petersen@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…t and not wait for closing of pipes (GH-151983) (#154171) gh-119710: fix asyncio Process.wait() to finish on process exit and not wait for closing of pipes (GH-151983) (cherry picked from commit f252132) Co-authored-by: Tobias Alex-Petersen <tobias.alex.petersen@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
…t and not wait for closing of pipes (GH-151983) (#154170) * gh-119710: fix asyncio Process.wait() to finish on process exit and not wait for closing of pipes (GH-151983) (cherry picked from commit f252132) Co-authored-by: Tobias Alex-Petersen <tobias.alex.petersen@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
| Back | FazBrowse Home | New Git URL |
gh-119710: Let asyncio Process.wait() finish on only process exit
Letting Process.wait() only wait on actual process return is closer to how it's documented and consistent with Popen.wait(). This also reduces complexity for waking waiters which was inconsistend depending on ordering of wait/exit.