[New-bugs-announce] [issue9895] Speed up test_subprocess
report at bugs.python.org
Sat Sep 18 20:24:56 CEST 2010
New submission from Antoine Pitrou <pitrou at free.fr>:
test_subprocess is currently very slow and the main culprit is test_no_leaking (here, it takes 80s out of the 100s needed for the whole run). This tests spawns as many subprocesses as would be needed to reach the max file descriptor limit. Spawning a subprocess is a heavy operation and consequently the test is very long.
This patch adopts another approach: it opens many file descriptors (using os.open()) until the max fd limit is reached, closes some of them (10 is enough) and then launches a bunch of subprocesses in a loop to check that they succeed. Consequently, the test is very fast (even on a Windows VM in debug mode).
nosy: brian.curtin, gregory.p.smith, pitrou, tim.golden
stage: patch review
title: Speed up test_subprocess
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file18921/noleaking.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce