-
Notifications
You must be signed in to change notification settings - Fork 224
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 bugs in _store_from_cache and repository.erase #3777
Conversation
The _store_from_cache needed to erase the content of its sandbox folder before copying over the content of the cache source. Currently, the existing contents are mixed with with the contents to be copied in. In fixing this, we discovered an issue in repository.erase, where an unstored node would try erasing the (inexistent) folder in the permanent repository, instead of the SandboxFolder.
I guess we should add some regression tests for this... |
The regression test creates a Data node with a file in a directory in the repository. After storing, it creates a clone, and stores it when caching is enabled. Finally, the hashes of the original and clone are compared. Checked that this test fails when the store_from_cache fix is not present.
@sphuber do you also want a regression test for the |
Actually, a very simple one should not be too much work and probably give a lot of mileage. Just one where you store some files and call erase on unstored node and one where you call erase after storing (passing |
@ltalirz in the |
2b702a2
to
a25bc4c
Compare
Docker check failing seems unrelated to this PR. |
For the repository tests, I added 3 cases:
|
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 @greschd looks good, just request to add small comment in the code
Changed it to implicitly rely on #3783. Failing on purpose right now, but it should start working again once that is merged and this branch is updated. |
The
_store_from_cache
needed to erase the content of its sandbox folder before copying over the content of the cache source. Currently, the existing contents are mixed with with the contentsto be copied in.
In fixing this, we discovered an issue in repository.erase, where an unstored node would try erasing the (inexistent) folder in the permanent repository, instead of the SandboxFolder.
Fixed in collaboration with @sphuber, so this should be reviewed by someone else.