Repository navigation
ci: parallel pytest (xdist) + uv installs for the heavy jobs - #196
Merged
Merged
Conversation
The four heavy jobs spent 83% of their wall in a sequential pytest run (283s coverage, ~224s per test-matrix leg) while pip re-resolved deps. - make collection deterministic: the source-time parametrize evaluated time.time(), giving every xdist worker its own collection - isolate migrated_cm onto tmp_path (restored on teardown) and ensure_zero_result before the recall_zero_results DELETE — both fed on the shared global base and floated once tests stopped interleaving - add -n auto to the test matrix and coverage jobs (2868 passed in ~75s locally, 4x the sequential wall) - typecheck/test/coverage/docs now use uv sync --locked + uv run; the aiosqlite pin is redundant (uv.lock holds 0.22.1, uv lock --check runs in lint)
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
install_ner_models.py shells out to 'sys.executable -m pip install <wheel URLs>'; a uv-created venv has no pip, so all four converted jobs failed at that step. 'uv venv --seed' before 'uv sync' gives the venv pip (verified locally: sync keeps the seeded pip), and setup-python's pip cache keeps the model wheels warm between runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Measured on run 41868292328: the four heavy jobs spend 83% of their wall in a sequential pytest run (coverage 283s, test legs ~190–224s), plus pip re-resolving deps (31–37s each). Caching was already doing its job (NER models: 5s via pip URL cache) — the lever is parallelism + faster installs.
What
test_source_time's parametrize evaluatedtime.time(), so every xdist worker collected a different test id (Different tests were collected). Replaced with a literal; semantics unchanged (the test asserts the numeric ts is forwarded as-is).migrated_cmintest_s17_stage1_tail.pymigrated the GLOBAL base; the chain test validated whatever other tests wrote there. Now isolated ontmp_path(restored on teardown). Tworecall_zero_resultstests fed on the shared base via a lazy-ensure table —ensure_zero_resultbefore theDELETE.-n autoon the test matrix and coverage jobs. Locally: 2868 passed in ~75s (sequential: ~305s) — 3 consecutive green parallel runs + green sequential.uv sync --locked+uv run) for typecheck/test/coverage/docs; theaiosqlitepin is redundant (uv.lockholds 0.22.1,uv lock --checkalready gates in lint).lint/quality/audit/builduntouched.This PR's own CI is the proof: all jobs green, with visibly lower walls for
test (3.12)andcoverage.