-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 Concurrent deletion of files at root level causes deadlock #8621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Concurrent deletion of files at root level causes deadlock #8621
Conversation
test_search_directoriestest_search_directories
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #8621 +/- ##
===========================================
- Coverage 87.51% 67.24% -20.27%
===========================================
Files 2010 836 -1174
Lines 78979 38032 -40947
Branches 1377 154 -1223
===========================================
- Hits 69118 25576 -43542
- Misses 9459 12407 +2948
+ Partials 402 49 -353
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…:giancarloromeo/osparc-simcore into is8619/fix-flaky-test-search-directories
matusdrobuliak66
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I get what was "fixed" here.
create_directory_with_files is used in many other tests.
What I see is that in case we run that test and interrupt it, the cleanup_files_closure might not be called --> which will leak files.
I find not very helpful to have 2 fixtures that do more or less the same, in the same package and nobody knows when to use one or the other. What was the issue?
pcrespov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing happened here!
pcrespov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess you noticed :-)
A real bug in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a flaky test in test_search_directories by improving test reliability and adding utility functions for file ID level detection. The changes introduce helper functions to determine file nesting levels and modify the deletion logic to skip parent directory updates for root-level files.
Key Changes:
- Added utility functions (
get_file_id_level,is_nested_level_file_id) to detect file nesting depth - Modified
delete_fileto conditionally update parent directories based on file nesting level - Enhanced test coverage with additional subdirectory test case and comprehensive parameterized tests
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
services/storage/src/simcore_service_storage/utils/simcore_s3_dsm_utils.py |
Introduces utility functions for calculating file ID levels and detecting nested files, plus updates to use S3_OBJECT_DELIMITER constant |
services/storage/src/simcore_service_storage/simcore_s3_dsm.py |
Modifies delete_file logic to skip parent directory updates for root-level files using the new is_nested_level_file_id check |
services/storage/tests/unit/test_simcore_s3_dsm.py |
Adds nested subdirectory test case to verify search functionality for deeper directory structures |
services/storage/tests/unit/test_simcore_s3_dsm_utils.py |
Adds comprehensive parameterized tests for the new utility functions covering edge cases and various path formats |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
test_search_directories
|
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
services/storage/src/simcore_service_storage/utils/simcore_s3_dsm_utils.py
Show resolved
Hide resolved
|
@mergify queue |
🟠 Waiting for conditions to match
|



What do these changes do?
This PR fixes a flaky test in
test_search_directoriesby improving test reliability and adding utility functions for file ID level detection. The changes introduce helper functions to determine file nesting levels and modify the deletion logic to skip parent directory updates for root-level files.Key Changes:
get_file_id_level,is_nested_level_file_id) to detect file nesting depthdelete_fileto conditionally update parent directories based on file nesting levelRelated issue/s
tests/unit/test_simcore_s3_dsm.py::test_search_directories#8619How to test
Dev-ops