-
Notifications
You must be signed in to change notification settings - Fork 50
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
fixes MissingDelegableApprovalError logging bug #789
fixes MissingDelegableApprovalError logging bug #789
Conversation
Signed-off-by: 2byrds <2byrds@gmail.com>
@@ -739,6 +739,8 @@ def test_delegables_escrow(): | |||
parsing.Parser().parse(ims=bytearray(gateIcp), kvy=torKvy, local=True) | |||
assert gateHab.pre not in torKvy.kevers | |||
assert len(torHab.db.delegables.get(keys=snKey(gateHab.kever.serder.preb, gateHab.kever.serder.sn))) == 1 | |||
# Exercise the MissingDelegableApprovalError case | |||
torKvy.processEscrowDelegables() |
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.
Is there expected to be additional assertions here to catch MissingDelegableApprovalError
?
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.
or should there be additional assertions to verify there wasn't a missing delegable approval error?
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.
seems odd to add the processing line but no assertions in the test
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.
Is there expected to be additional assertions here to catch
MissingDelegableApprovalError
?
No, the error is part of the escrow processing (the exception doesn't make it out of the processing).
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.
or should there be additional assertions to verify there wasn't a missing delegable approval error?
The test was valid originally, but it never exercised the MissingDelegableApprovalError so it didn't discover the logging error. This small addition does a better job of simulating that processEscrowDelegables is being called multiple times during the flow (becuase it is part of asynchronous escrow processing)
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.
seems odd to add the processing line but no assertions in the test
The constantly running escrow processors are difficult to capture in a small test. this is the shortest path to exercising the case when the processor runs before the user managed flow is complete.
@@ -5806,7 +5806,7 @@ def processEscrowDelegables(self): | |||
self.processEvent(serder=eserder, sigers=sigers, wigers=wigers, delseqner=seqner, | |||
delsaider=saider, local=esr.local) | |||
else: | |||
raise MissingDelegableApprovalError() | |||
raise MissingDelegableApprovalError("No delegation seal found for event.") |
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.
might be good to include the event digest?
MissingDelegableApprovalError("Missing Delegable Approval for evt at dig = {}.""".format(bytes(edig)))
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.
Yes, that would be better
Adds a message to the MissingDelegableApprovalError so the logging doesn't fail.
Updated test to exercise the exception and logging.