소스 검색

Merge pull request #5815 from gyuho/raft_test_fix

raft: give correct offset in unstable test
Gyu-Ho Lee 9 년 전
부모
커밋
150321f5ac
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      raft/log_unstable_test.go

+ 4 - 4
raft/log_unstable_test.go

@@ -237,9 +237,9 @@ func TestUnstableStableTo(t *testing.T) {
 			6, 1,
 			6, 1,
 		},
 		},
 		{
 		{
-			[]pb.Entry{{Index: 6, Term: 2}}, 5, nil,
+			[]pb.Entry{{Index: 6, Term: 2}}, 6, nil,
 			6, 1, // stable to the first entry and term mismatch
 			6, 1, // stable to the first entry and term mismatch
-			5, 1,
+			6, 1,
 		},
 		},
 		{
 		{
 			[]pb.Entry{{Index: 5, Term: 1}}, 5, nil,
 			[]pb.Entry{{Index: 5, Term: 1}}, 5, nil,
@@ -263,9 +263,9 @@ func TestUnstableStableTo(t *testing.T) {
 			6, 1,
 			6, 1,
 		},
 		},
 		{
 		{
-			[]pb.Entry{{Index: 6, Term: 2}}, 5, &pb.Snapshot{Metadata: pb.SnapshotMetadata{Index: 5, Term: 1}},
+			[]pb.Entry{{Index: 6, Term: 2}}, 6, &pb.Snapshot{Metadata: pb.SnapshotMetadata{Index: 5, Term: 1}},
 			6, 1, // stable to the first entry and term mismatch
 			6, 1, // stable to the first entry and term mismatch
-			5, 1,
+			6, 1,
 		},
 		},
 		{
 		{
 			[]pb.Entry{{Index: 5, Term: 1}}, 5, &pb.Snapshot{Metadata: pb.SnapshotMetadata{Index: 4, Term: 1}},
 			[]pb.Entry{{Index: 5, Term: 1}}, 5, &pb.Snapshot{Metadata: pb.SnapshotMetadata{Index: 4, Term: 1}},