You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python suite takes ~24 min serially; no parallelism, and per-test app setup costs up to ~10 s #524
Neither pyproject.toml, the Makefile nor pr.yml uses pytest-xdist, so the suite runs on a single core.
The slowest entries are mostly fixture setup, not test bodies:
tenants/tests/test_resolver_source.py::test_header_source_and_vary: 9.8 s setup
api_tokens/tests/test_api_tokens_service_keys.py::...: 9.8 s setup
branding/tests/test_tenant_branding_cost.py::...: 9.2 s setup
Those setups build a fresh create_app with its lifespan, and create every module's tables, for each test.
Cost
A 24-minute local run means contributors stop running the full suite and rely on CI. That defeats the "prove it before pushing" discipline the project asks for.
Main fix landed in #550 (f524a52): pytest-xdist with -n auto --dist loadgroup in make test-py and CI, per-session caching of discovered modules/model bases, and minimum-cost password hashing in tests — the suite went from ~24 min to ~5.5 min on 4 cores. CI writes the pytest totals line to the job summary, so run time is tracked. Per-worker schema reuse / a savepoint fixture is not pursued for now; reopen if setup time becomes a problem again.
Activity
test: keep repo-mutating and stack-sharing tests on one xdist worker
test: run the Python suite in parallel and cut per-app setup (#524) (#…
antosubash commentedon Oct 21, 2026
Main fix landed in #550 (f524a52): pytest-xdist with
-n auto --dist loadgroupinmake test-pyand CI, per-session caching of discovered modules/model bases, and minimum-cost password hashing in tests — the suite went from ~24 min to ~5.5 min on 4 cores. CI writes the pytest totals line to the job summary, so run time is tracked. Per-worker schema reuse / a savepoint fixture is not pursued for now; reopen if setup time becomes a problem again.