-
Notifications
You must be signed in to change notification settings - Fork 710
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
Set insufficient storage DeviceStatus in ContentSyncHook.post_transfer #11255
Set insufficient storage DeviceStatus in ContentSyncHook.post_transfer #11255
Conversation
Build Artifacts
|
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!
self._create_resources(self.admin_request.contentnode_id) | ||
mock_hook.post_transfer = lambda *args: ContentSyncHook.post_transfer( | ||
mock_hook, *args | ||
) |
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.
Looks like python2.7 tests are failing on this test. There shouldn't be any harm AFAIK in creating an instance of the ContentSyncHook
so you could try to remove the mocking.
2384ae1
into
learningequality:release-v0.16.x
Summary
Moves the logic that calculates the total size of incomplete downloads from the request processing method into its own class.
That class then is imported to and used in ContentSyncHook.post_transfer to set the DeviceStatus to InsufficientStorage whenever there is not enough space available for the sync.
References
Fixes #10382
Reviewer guidance
Do we need to unset this when there is enough space or anything like that?
Thoughts on test coverage would be appreciated. I pulled in and used some existing test classes to do the data setup for me. @rtibbles and I discussed a test case for the StorageCalculator class but it is kind of covered by way of the many integration tests using the
_process_content_requests
which repeatedly instantiate, use and rely on StorageCalculator.