-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix(cache): handle deleted files when calculating access times (#437) #437
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #437 +/- ##
==========================================
- Coverage 37.66% 36.36% -1.31%
==========================================
Files 26 26
Lines 1561 1573 +12
==========================================
- Hits 588 572 -16
- Misses 973 1001 +28
|
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.
LGTM, and very nicely done!
tests/test_utils.py
Outdated
tmp_path.joinpath("subdir", "b.txt").write_text("content of b") | ||
tmp_path.joinpath("c.txt").symlink_to("a.txt") | ||
tmp_path.joinpath("another_subdir").mkdir() | ||
before_calculating_times = time.time() + 1 |
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.
Just a very minor note: I found the name of the variable together with the +1
a bit confusing, since because of that +1
it will probably contain a time which is bigger than the time at which the times are calculated (therefore being "after" calculating times).
I guess the goal is checking that the access times are correctly returned and this means that they will need to be "later" then before_writing_files
and "earlier" than the moment in which the times are calculated, right? And I guess that the -1
and the +1
are rightly added to account for any potential delays in file system operations.
If so, what about renaming the variable to after_writing_files
to remove the ambiguity?
It's in any case a triviality, so feel free to amend it before merging or leave it as is :)
568874f
to
4b9bffd
Compare
4b9bffd
to
698900f
Compare
Closes reanahub/reana-job-controller#420
How to test: see related issue