mirror of
https://github.com/python/cpython.git
synced 2025-08-08 02:48:55 +00:00
[3.12] gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (GH-109431) (#109609)
gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (GH-109431) SubprocessProtocol process_exited() method can be called before pipe_data_received() and pipe_connection_lost() methods. Document it and adapt the test for that. Revert commit282edd7b2a
. _child_watcher_callback() calls immediately _process_exited(): don't add an additional delay with call_soon(). The reverted change didn't make _process_exited() more determistic: it can still be called before pipe_connection_lost() for example. (cherry picked from commitced6924630
) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Davide Rizzo <sorcio@gmail.com>
This commit is contained in:
parent
c3038bed1d
commit
5ba9d2b98f
4 changed files with 67 additions and 19 deletions
|
@ -226,8 +226,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
return transp
|
||||
|
||||
def _child_watcher_callback(self, pid, returncode, transp):
|
||||
# Skip one iteration for callbacks to be executed
|
||||
self.call_soon_threadsafe(self.call_soon, transp._process_exited, returncode)
|
||||
self.call_soon_threadsafe(transp._process_exited, returncode)
|
||||
|
||||
async def create_unix_connection(
|
||||
self, protocol_factory, path=None, *,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue