cpython/Lib
Joshua Herman 9e011e7c77
gh-82054: allow test runner to split test_asyncio to execute in parallel by sharding. (#103927)
This runs test_asyncio sub-tests in parallel using sharding from Cinder. This suite is typically the longest-pole in runs because it is a test package with a lot of further sub-tests otherwise run serially. By breaking out the sub-tests as independent modules we can run a lot more in parallel.

After porting we can see the direct impact on a multicore system.

Without this change:
  Running make test is 5 min 26 seconds
With this change:
  Running make test takes 3 min 39 seconds

That'll vary based on system and parallelism. On a `-j 4` run similar to what CI and buildbot systems often do, it reduced the overall test suite completion latency by 10%.

The drawbacks are that this implementation is hacky and due to the sorting of the tests it obscures when the asyncio tests occur and involves changing CPython test infrastructure but, the wall time saved it is worth it, especially in low-core count CI runs as it pulls a long tail. The win for productivity and reserved CI resource usage is significant.

Future tests that deserve to be refactored into split up suites to benefit from are test_concurrent_futures and the way the _test_multiprocessing suite gets run for all start methods. As exposed by passing the -o flag to python -m test to get a list of the 10 longest running tests.

---------

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google, LLC]
2023-04-29 18:26:24 -07:00
..
__phello__
asyncio gh-83925: Make asyncio.subprocess communicate similar to non-asyncio (#18650) 2023-04-27 17:30:26 -07:00
collections
concurrent
ctypes
curses gh-60436: fix curses textbox backspace/del (#103783) 2023-04-26 22:54:07 +02:00
dbm
email GH-103857: Deprecate utcnow and utcfromtimestamp (#103858) 2023-04-27 11:32:30 -06:00
encodings
ensurepip gh-103872: Update bundled pip version to 23.1.2 (gh-103873) 2023-04-26 10:22:25 +00:00
html
http GH-103857: Deprecate utcnow and utcfromtimestamp (#103858) 2023-04-27 11:32:30 -06:00
idlelib
importlib gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809) 2023-04-25 17:45:51 +00:00
json
lib2to3
logging
msilib
multiprocessing
pydoc_data
re
site-packages
sqlite3 gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945) 2023-04-27 21:22:26 +00:00
test gh-82054: allow test runner to split test_asyncio to execute in parallel by sharding. (#103927) 2023-04-29 18:26:24 -07:00
tkinter
tomllib
turtledemo
unittest gh-62432: unittest runner: Exit code 5 if no tests were run (#102051) 2023-04-27 01:28:46 +00:00
urllib
venv
wsgiref
xml
xmlrpc
zipfile
zoneinfo
__future__.py
__hello__.py
_aix_support.py
_collections_abc.py
_compat_pickle.py
_compression.py
_markupbase.py
_osx_support.py
_py_abc.py
_pydecimal.py
_pyio.py
_pylong.py
_sitebuiltins.py
_strptime.py GH-90750: Use datetime.fromisocalendar in _strptime (#103802) 2023-04-27 10:27:27 -06:00
_threading_local.py
_weakrefset.py
abc.py
aifc.py
antigravity.py
argparse.py
ast.py
base64.py
bdb.py
bisect.py
bz2.py
calendar.py gh-103636: issue warning for deprecated calendar constants (#103833) 2023-04-29 01:16:46 -06:00
cgi.py
cgitb.py
chunk.py
cmd.py
code.py
codecs.py
codeop.py
colorsys.py
compileall.py
configparser.py
contextlib.py gh-103791: Make contextlib.suppress also act on exceptions within an ExceptionGroup (#103792) 2023-04-24 22:17:02 +00:00
contextvars.py
copy.py
copyreg.py
cProfile.py gh-103935: Use io.open_code() when executing code in trace and profile modules (GH-103947) 2023-04-27 20:29:35 +00:00
crypt.py
csv.py
dataclasses.py
datetime.py GH-103857: Deprecate utcnow and utcfromtimestamp (#103858) 2023-04-27 11:32:30 -06:00
decimal.py
difflib.py
dis.py GH-99944: Make dis display the value of oparg of KW_NAMES (#103856) 2023-04-26 19:00:36 +01:00
doctest.py
enum.py
filecmp.py
fileinput.py
fnmatch.py
fractions.py
ftplib.py
functools.py
genericpath.py
getopt.py
getpass.py
gettext.py
glob.py
graphlib.py
gzip.py
hashlib.py
heapq.py
hmac.py
imaplib.py
imghdr.py
inspect.py
io.py
ipaddress.py
keyword.py
linecache.py
locale.py gh-74940: Allow fallback to UTF-8 encoding on systems with no locales installed (GH-14925) 2023-04-26 15:33:09 +09:00
lzma.py
mailbox.py
mailcap.py
mimetypes.py
modulefinder.py
netrc.py
nntplib.py
ntpath.py
nturl2path.py
numbers.py
opcode.py gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809) 2023-04-25 17:45:51 +00:00
operator.py
optparse.py
os.py
pathlib.py
pdb.py gh-103578: Fix pdb reading code with non-utf8 encoding (#103581) 2023-04-25 23:04:51 -06:00
pickle.py
pickletools.py
pipes.py
pkgutil.py gh-98040: Remove just the imp module (#98573) 2023-04-28 16:17:58 -07:00
platform.py
plistlib.py
poplib.py
posixpath.py
pprint.py
profile.py gh-103935: Use io.open_code() when executing code in trace and profile modules (GH-103947) 2023-04-27 20:29:35 +00:00
pstats.py
pty.py
py_compile.py
pyclbr.py
pydoc.py gh-98040: Remove just the imp module (#98573) 2023-04-28 16:17:58 -07:00
queue.py
quopri.py
random.py
reprlib.py
rlcompleter.py
runpy.py gh-98040: Remove just the imp module (#98573) 2023-04-28 16:17:58 -07:00
sched.py
secrets.py
selectors.py
shelve.py
shlex.py
shutil.py gh-82814: fix shutil access error on WSL (#103790) 2023-04-25 00:45:38 +00:00
signal.py
site.py
smtplib.py
sndhdr.py
socket.py
socketserver.py gh-103673: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer socketservers (#103674) 2023-04-24 22:35:52 +00:00
sre_compile.py
sre_constants.py
sre_parse.py
ssl.py
stat.py
statistics.py
string.py
stringprep.py
struct.py
subprocess.py
sunau.py
symtable.py
sysconfig.py
tabnanny.py
tarfile.py
telnetlib.py
tempfile.py gh-51574: Make tempfile.mkdtemp() always return absolute paths (#94612) 2023-04-25 16:05:59 +00:00
textwrap.py
this.py
threading.py
timeit.py
token.py
tokenize.py
trace.py gh-103935: Use io.open_code() when executing code in trace and profile modules (GH-103947) 2023-04-27 20:29:35 +00:00
traceback.py
tracemalloc.py
tty.py
turtle.py
types.py
typing.py
uu.py
uuid.py Update MAC_address wikipedia URL in comments (#29019) 2023-04-26 14:27:03 -06:00
warnings.py
wave.py
weakref.py
webbrowser.py
xdrlib.py
zipapp.py
zipimport.py