-
Notifications
You must be signed in to change notification settings - Fork 55
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Is there expected to be additional assertions here to catch There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe reason will be displayed to describe this comment to others. Learn more.
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. |
||
|
||
# Now create delegating interaction event | ||
seal = eventing.SealEvent(i=gateHab.pre, | ||
|
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