mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: remove unnecessary type conversion
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
b01d560be0
commit
0249c39cb3
@ -282,11 +282,11 @@ func TestCompactionSideEffects(t *testing.T) {
|
||||
lastTerm := lastIndex
|
||||
storage := NewMemoryStorage()
|
||||
for i = 1; i <= unstableIndex; i++ {
|
||||
storage.Append([]pb.Entry{{Term: uint64(i), Index: uint64(i)}})
|
||||
storage.Append([]pb.Entry{{Term: i, Index: i}})
|
||||
}
|
||||
raftLog := newLog(storage, raftLogger)
|
||||
for i = unstableIndex; i < lastIndex; i++ {
|
||||
raftLog.append(pb.Entry{Term: uint64(i + 1), Index: uint64(i + 1)})
|
||||
raftLog.append(pb.Entry{Term: i + 1, Index: i + 1})
|
||||
}
|
||||
|
||||
ok := raftLog.maybeCommit(lastIndex, lastTerm)
|
||||
|
@ -303,7 +303,7 @@ func TestLeaderElectionPreVote(t *testing.T) {
|
||||
|
||||
func testLeaderElection(t *testing.T, preVote bool) {
|
||||
var cfg func(*Config)
|
||||
candState := StateType(StateCandidate)
|
||||
candState := StateCandidate
|
||||
candTerm := uint64(1)
|
||||
if preVote {
|
||||
cfg = preVoteConfig
|
||||
@ -1675,7 +1675,7 @@ func TestAllServerStepdown(t *testing.T) {
|
||||
if sm.Term != tt.wterm {
|
||||
t.Errorf("#%d.%d term = %v , want %v", i, j, sm.Term, tt.wterm)
|
||||
}
|
||||
if uint64(sm.raftLog.lastIndex()) != tt.windex {
|
||||
if sm.raftLog.lastIndex() != tt.windex {
|
||||
t.Errorf("#%d.%d index = %v , want %v", i, j, sm.raftLog.lastIndex(), tt.windex)
|
||||
}
|
||||
if uint64(len(sm.raftLog.allEntries())) != tt.windex {
|
||||
|
Loading…
x
Reference in New Issue
Block a user