Skip to content

[3.8] bpo-38456: Use /bin/true in test_subprocess #16737

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
merged 2 commits into from
Oct 14, 2019

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Oct 12, 2019

Instead of sys.executable, "-c", "pass" or "import sys; sys.exit(0)"
use /bin/true when it is available. On a reasonable machine this
shaves up to two seconds wall time off the otherwise ~40sec execution
on a --with-pydebug build. It should be more notable on many
buildbots or overloaded slower I/O systems (CI, etc).

(cherry picked from commit 67b93f8)

https://bugs.python.org/issue38456

* bpo-38456: Use /bin/true in test_subprocess.

Instead of sys.executable, "-c", "pass" or "import sys; sys.exit(0)"
use /bin/true when it is available.  On a reasonable machine this
shaves up to two seconds wall time off the otherwise ~40sec execution
on a --with-pydebug build.  It should be more notable on many
buildbots or overloaded slower I/O systems (CI, etc)..
(cherry picked from commit 67b93f8)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
@gpshead
Copy link
Member Author

gpshead commented Oct 12, 2019

Applying this improvement to test_subprocess in 3.8 makes sense, but only after 3.8.0 is out the door.

backport of 46113e0 by Pablo Galindo.
@gpshead gpshead merged commit 4f0587f into python:3.8 Oct 14, 2019
@gpshead gpshead deleted the backport-67b93f8-3.8 branch October 14, 2019 20:40
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.

3 participants