Cut the 3 s pytest startup without a warm process
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 34/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- performance, testing
Research direction
Start by profiling the fast tier with python -X importtime and pytest --collect-only, with xdist off and on, then compare against main and a --testmon run selecting a few tests. Use the results to recommend which startup cost to address first; the issue leaves the implementation choice and whether selection size should control worker count to the maintainer.
Written by the indexing model from the issue text.
Description
Starting four xdist workers and collecting the tests costs 3.1–3.4 s per run, even when no test runs. That is about half the fast tier's wall time. #220 considered a warm test process (pytest-hot-reloading) and turned it down: it is alpha, lists Python only up to 3.12, drops the xdist workers, and can return stale results.
Ways to try, each measured against main on the fast tier and on a --testmon run that selects a few tests:
- Profile the startup. Use
python -X importtimeandpytest --collect-onlywith xdist off and on, to split the 3 s into interpreter start, plugin loading, imports during collection (torch, matplotlib, jsonschema, sklearn), and worker boot. - Defer heavy imports in test modules. Move module-level imports of torch, matplotlib and the experiment scripts into the tests or fixtures that use them, so that collection imports only what it needs.
- Skip xdist for small selections. When
--testmonor-kleaves only a few tests, run them in one process, since booting four workers costs more than it saves. pytest-xdist's-n autodoes not do this. Apytest_xdist_auto_num_workershook or a conftest check could. - Disable plugins the fast tier does not use, such as
-p no:entries inaddopts.
Questions for the maintainer:
- Which of these to try first? Proposed default: 1, then whichever of 2–4 the profile points to.
- Is changing worker count by selection size (3) acceptable, given that it makes a run's parallelism depend on how many tests it selects?
Refs #220.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 164
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from neurodata/prolearn
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 47/100
Maintainers usually reply within 1 day
-
Write which page each figure sits on, and what each figure drawsPossibly taken @jovo claimed this today. Open
neurodata/prolearn#272 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in neurodata/prolearn
Similar issues
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPossibly taken @jejjohnson claimed this today. Opentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jejjohnson/integrix#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
finos/ai-governance-framework#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days
-
type/bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
h2oai/h2o-llmstudio#1163 ·
Maintainers usually reply within 1 day