We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It is too rough to set the state directly, it is recommended to use becomeXXX
for i, tt := range tests { sm := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage()) sm.RaftLog = newLog(newMemoryStorageWithEnts([]pb.Entry{{}, {Index: 1, Term: 0}, {Index: 2, Term: 1}})) sm.Term = 1 sm.State = tt.state ... }
suggest:
switch tt.state { case StateFollower: sm.becomeFollower(1, None) case StateCandidate: sm.becomeCandidate() case StateLeader: sm.becomeCandidate() sm.becomeLeader() } sm.Term = 1
The text was updated successfully, but these errors were encountered:
PTAL @NingLin-P
Sorry, something went wrong.
No branches or pull requests
It is too rough to set the state directly, it is recommended to use becomeXXX
suggest:
The text was updated successfully, but these errors were encountered: