Skip to content

Commit

Permalink
storage: fix TestApplyPaginatedCommittedEntries, use MaxCommittedSize…
Browse files Browse the repository at this point in the history
…PerReady

I forgot to point 4787e3c towards this test. With that change, the test
was passing even without the corresponding fix. This commit changes the
test to also adopt `RaftMaxCommittedSizePerReady`, so that it fails again
without the fix from 38b4827.

Release note: None
  • Loading branch information
nvanbenschoten authored and ajwerner committed Dec 18, 2018
1 parent 3d338f5 commit 833abac
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/storage/replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9579,11 +9579,9 @@ func TestApplyPaginatedCommittedEntries(t *testing.T) {
tc := testContext{}
tsc := TestStoreConfig(nil)

// Drop the RaftMaxSizePerMsg so that even small Raft entries have their
// application paginated.
// TODO(nvanbenschoten): Switch this to using the new MaxCommitedSizePerReady
// configuration once #31511 is addressed.
tsc.RaftMaxSizePerMsg = 128
// Drop the RaftMaxCommittedSizePerReady so that even small Raft entries
// trigger pagination during entry application.
tsc.RaftMaxCommittedSizePerReady = 128
// Slow down the tick interval dramatically so that Raft groups can't rely
// on ticks to trigger Raft ready iterations.
tsc.RaftTickInterval = 5 * time.Second
Expand Down Expand Up @@ -9630,7 +9628,7 @@ func TestApplyPaginatedCommittedEntries(t *testing.T) {
for i := 0; i < 50; i++ {
var ba2 roachpb.BatchRequest
key := roachpb.Key("a")
put := putArgs(key, make([]byte, 2*tsc.RaftMaxSizePerMsg))
put := putArgs(key, make([]byte, 2*tsc.RaftMaxCommittedSizePerReady))
ba2.Add(&put)
ba2.Timestamp = tc.Clock().Now()

Expand All @@ -9643,7 +9641,7 @@ func TestApplyPaginatedCommittedEntries(t *testing.T) {

// Stop blocking Raft application. All of the proposals should quickly
// commit and apply, even if their application is paginated due to the
// small RaftMaxSizePerMsg.
// small RaftMaxCommittedSizePerReady.
close(blockRaftApplication)
const maxWait = 10 * time.Second
select {
Expand Down

0 comments on commit 833abac

Please sign in to comment.