@@ -591,12 +591,9 @@ func TestAppendPagination(t *testing.T) {
591591}
592592
593593func TestCommitPagination (t * testing.T ) {
594+ const maxCommittedSize = 2048
594595 s := newTestMemoryStorage (withPeers (1 ))
595- cfg := newTestConfig (1 , 10 , 1 , s )
596- cfg .MaxCommittedSizePerReady = 2048
597- rn , err := NewRawNode (cfg )
598- require .NoError (t , err )
599-
596+ rn := newTestRawNode (1 , 10 , 1 , s )
600597 require .NoError (t , rn .Campaign ())
601598
602599 // Persist vote.
@@ -630,17 +627,15 @@ func TestCommitPagination(t *testing.T) {
630627 rd = rn .Ready ()
631628 // TODO(pav-kv): we no longer need this test after the flow control policy is
632629 // moved up the stack.
633- committed , err := rn .LogSnapshot ().Slice (
634- rd .Committed , uint64 (rn .raft .raftLog .maxApplyingEntsSize ))
630+ committed , err := rn .LogSnapshot ().Slice (rd .Committed , maxCommittedSize )
635631 require .NoError (t , err )
636632 require .Len (t , committed , 2 )
637633 require .NoError (t , s .Append (rd .Entries ))
638634 rn .AdvanceHack (rd )
639635 rn .AckApplied (committed )
640636
641637 rd = rn .Ready ()
642- committed , err = rn .LogSnapshot ().Slice (
643- rd .Committed , uint64 (rn .raft .raftLog .maxApplyingEntsSize ))
638+ committed , err = rn .LogSnapshot ().Slice (rd .Committed , maxCommittedSize )
644639 require .NoError (t , err )
645640 require .Len (t , committed , 1 )
646641 require .NoError (t , s .Append (rd .Entries ))
0 commit comments