Visitar URL original
bpo-30317: Parameterize necessary timeouts in multiprocessing tests by applio · Pull Request #1722 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20250620120323/https://github.com/python/cpython/pull/1722
Skip to content

bpo-30317: Parameterize necessary timeouts in multiprocessing tests #1722

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

Closed

Conversation

applio
Copy link
Member

@applio applio commented May 22, 2017

Parameterize necessary timeouts in selected multiprocessing tests to better accommodate very slow buildbots.

@mention-bot
Copy link

@applio, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @shibturn and @jnoller to be potential reviewers.

@@ -1206,10 +1211,10 @@ class _TestBarrier(BaseTestCase):
Tests for Barrier objects.
"""
N = 5
defaultTimeout = 30.0 # XXX Slow Windows buildbots need generous timeout
default_timeout = 30.0 * TIMEOUT_MULTIPLIER
Copy link
Member

Choose a reason for hiding this comment

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

Why not just "timeout"?

# Particular buildbots can be exceptionally slow. Rather than raise timeouts
# (necessary in some tests) across the board to accomodate them, sensible
# timeout values may be scaled by this multiplier on such a buildbot.
TIMEOUT_MULTIPLIER = float(os.getenv("CONF_TIMEOUT_MULTIPLIER", default=1))
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to see this constant in test.support. I also suggest to rename it to TEST_TIMEOUT_MULTIPLIER or TEST_TIMEOUT_FACTOR.

@@ -58,7 +64,8 @@ def f(x):
p = Pool(5)
results = []
p.map_async(f, [1, 2, 3], callback=results.extend)
deadline = time.time() + 60 # up to 60 s to report the results
wait_in_secs = 10 * TIMEOUT_MULTIPLIER # up to 10 s to report the results
deadline = time.time() + wait_in_secs
Copy link
Member

Choose a reason for hiding this comment

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

Please use time.monotonic() rather than time.time() to implement a timeout to behave correctly when the system clock is updated.

@taleinat
Copy link
Contributor

taleinat commented Sep 6, 2018

Ping, @applio. If you're not going to address this, perhaps unassign yourself?

@vstinner
Copy link
Member

vstinner commented Sep 6, 2018

I spent a lot of time with @pablogsal to adjust many timeouts in multiprocessing tests and all buildbots are now green (tests pass). The number of multiprocessing random failures dropped a lot. I'm not sure that we still need this feature. If @applio doesn't reply, I suggest to close/reject it.

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.

7 participants