Repository navigation
Split slow tests into parallel 2D and 3D jobs - #11
Merged
Merged
Conversation
The slow-tests run on push-to-main was hitting 30+ min because free GitHub Linux runners only provide 2 CPUs (xdist '-n auto' spawns 2 workers, not 4 as I'd projected). Halve wall-time by running 2D and 3D as two separate parallel jobs: - conftest.py: pytest_collection_modifyitems now honors both CYTO_DL_SKIP_3D=1 and CYTO_DL_SKIP_2D=1, mirroring each other. Either env var alone behaves as before; setting both would deselect everything (not used). - slow-tests.yml: matrix.include with two entries (dims=2 and dims=3), each setting the opposite skip env var. Both jobs run on free runners in parallel, so the effective parallelism is 2 jobs x 2 xdist workers = 4 workers across the matrix. Expected wall-time: ~10-12 min per leg, ~12 min total (limited by the slower 3D leg). https://claude.ai/code/session_01Fri5KfdBh8FT5szwJMojtW
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.
What does this PR do?
This PR optimizes CI performance by splitting the slow-tests workflow into two parallel jobs that run 2D and 3D tests separately, rather than running both in a single job. This halves the wall-clock time for the slow-tests workflow on push-to-main.
Changes:
conftest.py: Extended the test filtering logic to support both
CYTO_DL_SKIP_3DandCYTO_DL_SKIP_2Denvironment variables, allowing selective skipping of either 2D or 3D parametrized tests based on spatial dimensions.slow-tests.yml: Converted the single slow-test job into a matrix strategy with two parallel jobs:
Each job is properly labeled and passes the appropriate skip flags via environment variables.
This approach maintains full test coverage while reducing CI execution time by running the expensive 3D tests in parallel with 2D tests.
Before submitting
pytestcommand?pre-commit run -acommand?Breaking changes: None. The changes are backward compatible—existing behavior is preserved when neither skip flag is set.
Did you have fun?
Optimizing CI workflows is always satisfying! 🚀
https://claude.ai/code/session_01Fri5KfdBh8FT5szwJMojtW