storage: avoid removing the xva/vdi before going in the debugger#436
Conversation
879aec3 to
7c53280
Compare
80ec1b3 to
76b60de
Compare
76b60de to
12bb98b
Compare
080ee74 to
c130ebc
Compare
| def test_coalesce(self, storage_test_vm: VM, vdi_on_lvm_sr: VDI, vdi_op: CoalesceOperation): | ||
| coalesce_integrity(storage_test_vm, vdi_on_lvm_sr, vdi_op) | ||
| def test_coalesce( | ||
| self, storage_test_vm: VM, vdi_on_lvm_sr: VDI, vdi_op: CoalesceOperation, defer: Defer |
There was a problem hiding this comment.
nitpick: some newlines would help readability
There was a problem hiding this comment.
I could agree, but I won't start arguing about coding style :)
There was a problem hiding this comment.
Nitpick 2 : so much reformatting in commit 2 that I had difficulties finding the actual changes.
There was a problem hiding this comment.
Meld does a better job than github, thankfully
There was a problem hiding this comment.
Ok, so we are talking about coding style.
nitpick: some newlines would help readability
In this code base, I think the coding style tends to keep things vertically compact. Newlines would go against that.
Nitpick 2 : so much reformatting in commit 2 that I had difficulties finding the actual changes.
Indeed github is not very good at that.
The lines became longer than our 120-character limit. Would you have preferred to keep the first part of the parameters on the same line? The line would still have been modified
def test_coalesce(self, storage_test_vm: VM, vdi_on_lvm_sr: VDI, vdi_op: CoalesceOperation):would become
def test_coalesce(self, storage_test_vm: VM, vdi_on_lvm_sr: VDI, vdi_op: CoalesceOperation,
defer: Defer):There was a problem hiding this comment.
With a good diff tool, the current commit is fine for me. But the "onboarding" when opening commit 2 in github was not the best, and it's not necessarily on you :)
There was a problem hiding this comment.
I reordered the commit to use defer directly and avoid reaching the 120-character limit in most cases, and minimized changes as much as possible.
| sr.forget() | ||
|
|
||
| @pytest.fixture() | ||
| def defer(request: pytest.FixtureRequest) -> Defer: |
There was a problem hiding this comment.
It would be nice to describe the defer fixture in the commit message. Here all the details are in the documentation of the fixture, which is nice in itself, but at first I was confused by the diff, and people from the future looking for the origin of this change might be do. Something as simple as inviting to check the doc of the defer fixture in the global conftest.py would be enough.
| args = {'uuid': uuid, 'param-name': param_name} | ||
| host.xe(f'{xe_prefix}-param-clear', args) | ||
|
|
||
| Defer = Callable[[Callable[[], object]], None] |
There was a problem hiding this comment.
Move this up with the other type definitions?
c130ebc to
89b31a9
Compare
6d2d859 to
ef4ead1
Compare
ef4ead1 to
cd1c5d4
Compare
cd1c5d4 to
27d715c
Compare
27d715c to
aeaca44
Compare
aeaca44 to
b2250b7
Compare
In case of exception, the cleanup code in try…finally was removing the xva image before getting in the debugger, making impossible to look at the xva content. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Replace try-finally blocks with defer calls in storage tests to keep VDIs available when entering the debugger. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
b2250b7 to
3470670
Compare
In case of exception, the cleanup code in try…finally was removing the
xva image before getting in the debugger, making impossible to look at
the xva content.
This PR is part of a tree containing 19 PRs:
mastermaster