Skip to content

bpo-36888: Increase timeout in test_parent_process #14286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pierreglaser
Copy link
Contributor

@pierreglaser pierreglaser commented Jun 21, 2019

Attempt to fix the buildbot failures reported in the original bpo issue.

We (@tomMoral and I) suspect that the AssertionError comes from the child process and the grand-child processes taking more than 5 seconds to get up and running, making the following calls to rconn.poll(timeout=5) return False.

The proposed fix here is therefore to give more time for the child processes to start by increasing the timeout in the rconn.poll calls.

We also increase the life-span of the child process to make sure the it is not dead when the grand-child process starts executing.

cc @vstinner :)

https://bugs.python.org/issue36888

@tomMoral
Copy link
Contributor

I agree this looks like an issue due to timeout that are too short. This PR should fix this.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_parent_process() seems to be designed around time. That's a very weird synchronization primitation, it's not reliable at all. Can't you use another more reliable synchronization primitive? Something like https://docs.python.org/dev/library/multiprocessing.html#multiprocessing.Event?

cc @pablogsal

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@tomMoral
Copy link
Contributor

The synchronization here does not rely on time bu is done thru the multiprocessing.Pipe object which is used as a communication channel. The timeout are only here to safeguard against hanged interpreters. Using mp.Event would lead to very similar code, as to avoid frozen interpreters, we would need to rely on Event.wait with non-zero timeout, which would be equivalent to the poll with non-zero timeout.

@vstinner vstinner merged commit 594d9b9 into python:master Jun 25, 2019
@miss-islington
Copy link
Contributor

Thanks @pierreglaser for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-14382 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 25, 2019
miss-islington added a commit that referenced this pull request Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants