-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Adding used storage quota to borg info #7121
Conversation
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.
also: please run the test locally before pushing to github.
you can just invoke pytest or tox in your workdir.
The quota info should be persisted in the hints file. |
I'm running the tests on my computer. I have a lot of failing tests because RemoteArchiver doesn't have the attr storage_quota. In the new implementarion of
|
self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION, "--storage-quota=1G") | ||
self.cmd(f"--repo={self.repository_location}", "create", "test", "input") | ||
info_repo = self.cmd(f"--repo={self.repository_location}", "rinfo") | ||
assert "Storage quota" in info_repo |
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.
would be good if this also tested the 2 values (used/total).
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 have a problem with this. In the test I added the used quota is different if I execute the test file or if I execute the test on its own.
The difference is in the tens of byte I think, so I made the file in the test bigger to make it work.
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.
That sounds strange, considering that the test rcreate
s a new repository in both cases.
Hmm, due to it using new key material, the chunker might behave differently, cutting different chunks, leading to slightly different compressed chunk sizes or different chunk counts.
Try replacing RK_ENCRYPTION with "--encryption=none"
to avoid this.
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.
It also fails without encryption
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.
So, this is kind of resolved using the bigger test file now?
btw, there is already a |
are you still working on this? some stuff still to do, see my comments. |
I've been busy the last two weeks. I'm gonna be able to resume next Monday I think. |
I can't find the cause of the error when working with a remote repository. By the way, do you think everything else I have worked on is finished? |
Hmm, does the problem with remote repos only happen when testing manually? The tests on github CI do not show a problem. |
The tests were passing because of the diaper pattern. I removed it. |
It would fail for all python versions. That you do not see failure for all is just because the |
Triggered by:
It looks like it calls info() from there just to get the repo id and mode. Check if it needs the quota info there. The problem might be that if do_open is called with create=True, the |
That was the case, there was no hints file. But this only happens with remote repos, when creating a local one the files hints, integrity, etc are created. |
Is there a reason why you haven't seen this? |
I've seen it, just needed some time to have a deeper look at the code. Overall, it looks pretty good now, just 2 minor changes. After that I guess it can be squashed together and merged. |
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
Fixes #2870.