-
Notifications
You must be signed in to change notification settings - Fork 164
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
Test: Replace t.error/fatal with assert/request in [raft_test.go] #173
Test: Replace t.error/fatal with assert/request in [raft_test.go] #173
Conversation
22288ae
to
c5a8c0d
Compare
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, with a few nits/suggestions.
Thanks a lot for this clean-up!
Thank you for your review. I must admit that I may have been a bit hasty in submitting this PR with multiple errors and inconsistencies. And I'll try to double-check everything before the next commit. |
d437e80
to
ac496c5
Compare
if sm.id == campaignerID { | ||
assert.Equal(t, StateLeader, sm.state, "preVote=%v: campaigning node %d", preVote, sm.id) | ||
} else { | ||
assert.Equal(t, StateFollower, sm.state, "preVote=%v: campaigning node %d, current node %d", preVote, campaignerID, sm.id) |
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.
Nice minor refactor & simplification!
Part of: etcd-io#146 Signed-off-by: Xinyuan Du <xinyuan.du@broadcom.cn>
ac496c5
to
176e8a7
Compare
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
Thank you!
Refactor: Replacing t.Error/t.Fatal with assert/require
This commit tries to eliminates boilerplate code in the testing suite by replacing occurrences
of t.Error and t.Fatal with assertions from the assert and require packages.
Changes Made:
Affected Files:
Part of: #146