-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove unwrap() in linera-core tests when possible.
#4348
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
base: main
Are you sure you want to change the base?
Conversation
|
My issue with this change is that tests that fail at
In the second case the actual source of the failure is buried at 6th position of the stacktrace. |
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 don't see anything wrong with the PR apart from the comment I made earlier. (Not approving just yet to let other weigh in on the topic).
Yes, this is exactly the reason |
Ok. Now, if the goal is to know the line where the problem occurs, then I think we are doing it all wrong. (1) There are already some ? in the test code. Pointedly, it is for code that tends to fail the test:
(2) There are
Of course, "rare error" and "frequent error" are vague terminology. This is why I proposed to introduce ? systematically. |
Motivation
The test code of
linera-coreis a little complicated. Some of this complication can be reduced by replacing.unwrap()by?.Proposal
This is done but only for the
Result<_,_>return values. TheOptionare left untouched.This adds to the clarity of the code as one sees more clearly what is Result and what is Option.
Test Plan
The CI.
Release Plan
Links
None.