Some UI layer tests take longer than expected to run
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- performance, testing-qa
Research direction
Start by running pytest --durations=0 tests/test_ui_layer.py and inspect the five slowest cases in tests/test_ui_layer.py, especially the pipeline-building tests. Trace what makes those cases slower than the others and verify that the full test file still passes with reduced durations and unchanged behavior.
Written by the indexing model from the issue text.
Description
The top 5 stick out, in comparison to the rest of tests which take 0.01s or less:
(base) root@57b6bd69e7ba:/httomo# pytest --durations=0 tests/test_ui_layer.py
========================================== test session starts ===========================================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0 -- /opt/conda/bin/python3.12
cachedir: .pytest_cache
rootdir: /httomo
configfile: pyproject.toml
plugins: xdist-3.6.1, mpi-0.6, mock-3.14.0, cov-6.0.0
collected 20 items
tests/test_ui_layer.py::test_can_read_cpu_pipeline PASSED [ 5%]
tests/test_ui_layer.py::test_can_read_gpu_pipeline PASSED [ 10%]
tests/test_ui_layer.py::test_uilayer_fails_with_nonexistant_file[does_not_exist.yaml] PASSED [ 15%]
tests/test_ui_layer.py::test_pipeline_build_no_loader PASSED [ 20%]
tests/test_ui_layer.py::test_pipeline_build_duplicate_id PASSED [ 25%]
tests/test_ui_layer.py::test_pipeline_build_cpu_pipeline PASSED [ 30%]
tests/test_ui_layer.py::test_build_pipeline_from_json PASSED [ 35%]
tests/test_ui_layer.py::test_build_pipeline_with_param_sweeps[manual] PASSED [ 40%]
tests/test_ui_layer.py::test_build_pipeline_with_param_sweeps[range] PASSED [ 45%]
tests/test_ui_layer.py::test_raise_error_if_pipeline_is_yaml_string PASSED [ 50%]
tests/test_ui_layer.py::test_raise_error_if_pipeline_is_json_file PASSED [ 55%]
tests/test_ui_layer.py::test_update_side_output_references_invalid[no_ref] PASSED [ 60%]
tests/test_ui_layer.py::test_update_side_output_references_invalid[as ${{mixed_with_other}}] PASSED [ 65%]
tests/test_ui_layer.py::test_update_side_output_references_invalid[${{mixed_with_other}} asd] PASSED [ 70%]
tests/test_ui_layer.py::test_update_side_output_references_invalid[${{}}] PASSED [ 75%]
tests/test_ui_layer.py::test_update_side_output_references_invalid[${{with spaces}}] PASSED [ 80%]
tests/test_ui_layer.py::test_update_side_output_references_invalid[${{inV-1%^&valid_chars}}] PASSED [ 85%]
tests/test_ui_layer.py::test_update_side_output_references_normal PASSED [ 90%]
tests/test_ui_layer.py::test_update_side_output_references_nosidestr PASSED [ 95%]
tests/test_ui_layer.py::test_update_side_output_references_notfound PASSED [100%]
=========================================== slowest durations ============================================
1.02s call tests/test_ui_layer.py::test_pipeline_build_cpu_pipeline
0.79s call tests/test_ui_layer.py::test_pipeline_build_duplicate_id
0.36s call tests/test_ui_layer.py::test_build_pipeline_with_param_sweeps[range]
0.32s call tests/test_ui_layer.py::test_build_pipeline_with_param_sweeps[manual]
0.23s call tests/test_ui_layer.py::test_build_pipeline_from_json
0.02s call tests/test_ui_layer.py::test_can_read_cpu_pipeline
0.01s setup tests/test_ui_layer.py::test_raise_error_if_pipeline_is_json_file
0.01s call tests/test_ui_layer.py::test_pipeline_build_no_loader
0.01s call tests/test_ui_layer.py::test_can_read_gpu_pipeline
0.01s call tests/test_ui_layer.py::test_update_side_output_references_notfound
0.01s call tests/test_ui_layer.py::test_update_side_output_references_normal
(49 durations < 0.005s hidden. Use -vv to show these durations.)
=========================================== 20 passed in 2.91s ===========================================
- Dominant language
- Python
- Stars
- 10
- Forks
- 5
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
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 DiamondLightSource/httomo
-
ci
Difficulty 1/5 Under an hour Newbie friendliness 88/100
DiamondLightSource/httomo#714 ·
-
framework minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DiamondLightSource/httomo#699 ·
-
documentation question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/httomo#697 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
DiamondLightSource/httomo#609 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
DiamondLightSource/httomo#607 ·
All issues in DiamondLightSource/httomo
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100