pytest: enable xdist usage

The testsuite has grown in size quite a bit.  It takes ~3 min on
my cloudtop with ~48 cores.  Running it in parallel makes it take
~20 seconds.

I've capped it to 32 jobs because it seems to complete in the same
amount of time as 128 jobs, and there's startup cost to spinning
up each node.

Change-Id: I6daa456a92e9db213118c9d16c9dee646db448e0
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/655887
Tested-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Mike Frysinger authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-11-11 09:14:21 -08:00
1 parent 0714b7e434
commit 9b774577cb
4 files changed
+23

No files matched your search

+9
View File
@@ -41,6 +41,15 @@ extend_skip_glob = '*_pb2.py'
single_line_exclusions = ['abc', 'collections.abc', 'typing']
[tool.pytest.ini_options]
addopts = [
"--durations=5",
"--durations-min=1.0",
"--strict-markers",
"--numprocesses=auto",
# Currently the test suite doesn't seem to get faster with more threads,
# so cap it here for now since there's a startup cost for every one.
"--maxprocesses=32",
]
markers = """
skip_cq: Skip tests in the CQ. Should be rarely used!
e2e: Hermetic end-to-end tests (tests/e2e/). Deselect with -m 'not e2e'.
+1
View File
@@ -19,6 +19,7 @@
# requires-python = '>=3.11,<3.12'
# dependencies = [
# 'pytest==8.3.4',
# 'pytest-xdist==3.8.0',
# 'black==25.1.0',
# 'flake8==7.4.1',
# 'flake8-bugbear==26.9.30',
+8
View File
@@ -14,6 +14,10 @@ colorama==0.4.6 ; python_full_version < '3.12' and sys_platform == 'win32' \
# via
# click
# pytest
execnet==2.1.1 ; python_full_version < '3.12' \
--hash=sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc \
--hash=sha256:58d6d58362e52bfab78f40ebfed9575a3334c41593bee4eb5fcda518290018dc
# via pytest-xdist
flake8==7.4.1 ; python_full_version < '3.12' \
--hash=sha256:7ff3b14668bfec70da5ce3eeaf1756098330598a9a69f1ee312ed315d27c6508
# via
@@ -73,3 +77,7 @@ pyflakes==4.0.3 ; python_full_version < '3.12' \
pytest==8.3.4 ; python_full_version < '3.12' \
--hash=sha256:00cba7845d2dccfe5403025a688d60ceae228b1ddaa866d2eb86b2edb6923e73 \
--hash=sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6
# via pytest-xdist
pytest-xdist==3.8.0 ; python_full_version < '3.12' \
--hash=sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88 \
--hash=sha256:9e659fa2eacbed776070a08a075eff2d9c8e010bab4eea169640c22a1b079f2c
+5
View File
@@ -65,3 +65,8 @@ wheel: <
name: "infra/python/wheels/exceptiongroup-py3"
version: "version:1.1.2"
>
wheel: <
name: "infra/python/wheels/pytest-xdist-py2_py3"
version: "version:1.31.0"
>