Skip to content

Commit

Permalink
TestReadOnlyWithLearner
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
  • Loading branch information
tbg committed Sep 20, 2022
1 parent b462fd1 commit 182e1a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion raft/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,8 @@ func TestReadOnlyOptionSafe(t *testing.T) {
}

func TestReadOnlyWithLearner(t *testing.T) {
a := newTestLearnerRaft(1, 10, 1, newTestMemoryStorage(withPeers(1), withLearners(2)))
s := newTestMemoryStorage(withPeers(1), withLearners(2))
a := newTestLearnerRaft(1, 10, 1, s)
b := newTestLearnerRaft(2, 10, 1, newTestMemoryStorage(withPeers(1), withLearners(2)))

nt := newNetwork(a, b)
Expand Down Expand Up @@ -2277,6 +2278,7 @@ func TestReadOnlyWithLearner(t *testing.T) {
for i, tt := range tests {
for j := 0; j < tt.proposals; j++ {
nt.send(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{}}})
nextEnts(a, s) // append the entries on the leader
}

nt.send(pb.Message{From: tt.sm.id, To: tt.sm.id, Type: pb.MsgReadIndex, Entries: []pb.Entry{{Data: tt.wctx}}})
Expand Down

0 comments on commit 182e1a3

Please sign in to comment.