Skip to content

Commit

Permalink
increase maxraftstate check to 8x just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
uakfdotb committed Apr 17, 2020
1 parent 53d2914 commit 4dff6f2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/kvraft/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func partitioner(t *testing.T, cfg *config, ch chan bool, done *int32) {
// servers crash after the period is over and restart. If partitions is set,
// the test repartitions the network concurrently with the clients and servers. If
// maxraftstate is a positive number, the size of the state for Raft (i.e., log
// size) shouldn't exceed 4*maxraftstate. If maxraftstate is negative,
// size) shouldn't exceed 8*maxraftstate. If maxraftstate is negative,
// snapshots shouldn't be used.
func GenericTest(t *testing.T, part string, nclients int, unreliable bool, crash bool, partitions bool, maxraftstate int) {

Expand Down Expand Up @@ -275,8 +275,8 @@ func GenericTest(t *testing.T, part string, nclients int, unreliable bool, crash
// Check maximum after the servers have processed all client
// requests and had time to checkpoint.
sz := cfg.LogSize()
if sz > 4*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 4*%v)", sz, maxraftstate)
if sz > 8*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 8*%v)", sz, maxraftstate)
}
}
if maxraftstate < 0 {
Expand Down Expand Up @@ -417,8 +417,8 @@ func GenericTestLinearizability(t *testing.T, part string, nclients int, nserver
// Check maximum after the servers have processed all client
// requests and had time to checkpoint.
sz := cfg.LogSize()
if sz > 4*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 4*%v)", sz, maxraftstate)
if sz > 8*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 8*%v)", sz, maxraftstate)
}
}
}
Expand Down Expand Up @@ -643,8 +643,8 @@ func TestSnapshotRPC3B(t *testing.T) {
// check that the majority partition has thrown away
// most of its log entries.
sz := cfg.LogSize()
if sz > 4*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 4*%v)", sz, maxraftstate)
if sz > 8*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 8*%v)", sz, maxraftstate)
}

// now make group that requires participation of
Expand Down Expand Up @@ -693,8 +693,8 @@ func TestSnapshotSize3B(t *testing.T) {

// check that servers have thrown away most of their log entries
sz := cfg.LogSize()
if sz > 4*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 4*%v)", sz, maxraftstate)
if sz > 8*maxraftstate {
t.Fatalf("logs were not trimmed (%v > 8*%v)", sz, maxraftstate)
}

// check that the snapshots are not unreasonably large
Expand Down

0 comments on commit 4dff6f2

Please sign in to comment.