Repository navigation
Done
Labels
refactorCodebase quality roadmap
Description
Part of #336. Size: S–M.
Problem
Measured on main (24k tests):
| Where | How | Wall time |
|---|---|---|
Local, make test-python |
serial | about 25 min |
Local, -n 8 --dist worksteal (10-core Mac) |
parallel | 4 min 47 s |
| CI primary job | shard 1/2, -n 4, plus lint, naming, shell, fixture smoke, UI and extraction SDK tests |
9 min 10 s |
| CI secondary job | shard 2/2, -n 4 |
5 min 52 s (pytest 4 min 56 s) |
make test-pythondoes not parallelise locally, althoughpytest-xdistis a test dependency and CI already uses it.- The primary CI job also runs every static check and the Node/SDK suites, so it finishes about 3 minutes after the secondary job and sets the wall time.
- A few tests dominate a worker:
tests/web_search/test_native_revisions.py::test_locked_reference_extensions_rescore_all_methods_without_replacing_original_goldtakes 174 s; sixtests/benchmarks/webfetch/test_release_versions.pycases andtest_benchmark.py::PublicDefinitions::test_all_shipped_suites_are_consistenttake 32–36 s each, mostly re-validating the full shipped catalog;test_explicit_utf8_io.py::test_report_builds_are_byte_identical_under_an_ascii_localetakes 34 s. - Shards are assigned by hashing test ids, not by duration.
Direction
make test-pythonruns with-n auto --dist workstealby default (overridable), and CONTRIBUTING.md says so.- Move lint, naming, shell, fixture smoke, UI and extraction SDK checks into their own CI job so both pytest shards carry only pytest.
- Cut the slowest tests without losing coverage: validate the shipped catalog once per session and share it (fixture), and reduce the 174 s revision test to the smallest population that exercises the same rules.
- Optionally shard by recorded durations if the shards stay unbalanced after 2 and 3.
Done when
- Local tests run in parallel by default and CI runs pytest separately from static checks (done in test: run tests in parallel, split CI static checks, trim slow tests and fold golden snapshots #358).
- Every test file has been reviewed once for necessity and cost (test: prune and speed up tests/benchmarks #361–test: prune and speed up root tests m-z #365); remaining slow tests are either necessary at their size or tracked with the reason they stay.
- Further cuts are taken when they are cheap and keep coverage; there is no fixed time target. Do not delete a meaningful test or add production seams only to save seconds.
Metadata
Metadata
Assignees
Labels
refactorCodebase quality roadmap
Activity
lanyue-llk commentedon Nov 24, 2026
Done: local tests run in parallel by default and CI runs pytest apart from static checks (#358); every test file was reviewed once for necessity and cost (#361–#365). CI wall time went from 9 min 10 s to about 4 min 25 s. Per the revised criteria there is no fixed time target; further cheap cuts can be taken as they come up.