Skip to content

bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio - #27870

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:test_subprocess_wait_no_same_group
Aug 21, 2021
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:test_subprocess_wait_no_same_group

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 21, 2021 •

Copy link
Copy Markdown
Member

The code of the test was never executed because the test function
was unintentionally converted to a generator function.

https://bugs.python.org/issue44968

The code of the test was never executed because the test function
was unintentionally converted to a generator function.
@nightlark

nightlark commented Aug 21, 2021 •

Copy link
Copy Markdown
Contributor

I tried running the tests with this as a "fix" a few hours ago (https://bugs.python.org/msg400014 nightlark@4505f6b), but the resulting output had these lines at the end that make it seem like it isn't quite working right:

Unknown child process pid 13200, will report returncode 255
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 13200 is closed

Here's the output from that test run: https://github.com/nightlark/cpython/runs/3387597450?check_suite_focus=true

@nightlark

nightlark commented Aug 21, 2021 •

Copy link
Copy Markdown
Contributor

This is where I'm at right now, adding an exited future to the MySubprocessProtocol class: nightlark@2ac88fd

With this change the unknown child process message seems to become intermittent, and when it does appear it shows up above the == Tests result: SUCCESS == line in the log (versus before where it seems to often be mixed in with output at the bottom of the log).

Here's a new test run showing the now intermittent nature of it, 1.1.1k without that line of output and 3.0.0 with: https://github.com/nightlark/cpython/runs/3388293440?check_suite_focus=true

Update: Ran tests with both variations several more times, whether or not those lines appear seems to be intermittent regardless of whether completed or exited is used.

Update 2: Looking through logs from CI test runs before the deprecation warning was made, the unknown child process output lines still appeared so they could be coming from a completely different test -- I just started looking at CPython ~2 days ago, I'd be very interested in getting insight from someone about the cause of those lines to help me learn my way around the codebase.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I think that the completed future should be set in process_exited() instead of pipe_connection_lost(). returncode which is set in process_exited() is always tested after completing the completed future.

But this is a different issue.

@serhiy-storchaka
serhiy-storchaka merged commit 585390f into python:main Aug 21, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the test_subprocess_wait_no_same_group branch August 21, 2021 20:09
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 21, 2021
…thonGH-27870)

The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-27877 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 21, 2021
…thonGH-27870)

The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-27878 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit that referenced this pull request Aug 21, 2021
…-27870)

The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this pull request Aug 21, 2021
…-27870)

The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants