Repository navigation
Fix flaky test_shuffle_streamlines by seeding the shuffle - #1369
Merged
Merged
Conversation
Co-authored-by: frheault <10820351+frheault@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix the failing GitHub Actions job test
Fix flaky test_shuffle_streamlines by seeding the shuffle
Oct 20, 2026
Member
|
@arnaudbore This kept failling in another PR and so I tried ''fix with copilot'' |
arnaudbore
approved these changes
Oct 21, 2026
frheault
marked this pull request as ready for review
October 21, 2026 15:58
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1369 +/- ##
==========================================
- Coverage 72.58% 72.57% -0.02%
==========================================
Files 301 301
Lines 26279 26279
Branches 3702 3702
==========================================
- Hits 19075 19072 -3
Misses 5654 5654
- Partials 1550 1553 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
arnaudbore
approved these changes
Oct 21, 2026
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.
Quick description
The
testCI job failed ontest_shuffle_streamlines. The test shuffles a 4-streamline tractogram without a seed and asserts the result differs from the input. A uniform shuffle of 4 items returns the identity permutation 1 time in 24 (~4%), so the assertion fails at random.test_shuffle_streamlinesnow callsshuffle_streamlines(sft, rng_seed=0). I checked in plain Python thatrandom.seed(0)followed byrandom.shuffleon 4 items gives[2, 0, 1, 3], a non-identity order. The test is now deterministic.Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
I have not run this test locally. The sandbox had no numpy installed.
Checklist