mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: give correct offset in unstable test
`unstable.entries[i] has raft log position i+unstable.offset` So, this fixes some test cases by giving them correct offsets.
This commit is contained in:
parent
66d195ff75
commit
2cc2372165
@ -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}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user