Skip to content

Commit

Permalink
raft: deflake non-determinisctic raft node tests
Browse files Browse the repository at this point in the history
We sporadically see that some raft node_test tests fail due to the
leader not being stable. This commit should reduce the chances of that
happening by increasing the election timeout to 250ms (instead of 50ms).

I couldn't reproduce the bug locally with this change.

If the bug still happens, we can try to force leadership to make it
more deterministic.

Fixes: #132992

Release note: None
  • Loading branch information
iskettaneh committed Oct 23, 2024
1 parent a66eebc commit 359c832
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/raft/rafttest/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func startNode(id uint64, peers []raft.Peer, iface iface) *node {
st := raft.NewMemoryStorage()
c := &raft.Config{
ID: id,
ElectionTick: 10,
ElectionTick: 50,
HeartbeatTick: 1,
Storage: st,
MaxSizePerMsg: 1024 * 1024,
Expand Down

0 comments on commit 359c832

Please sign in to comment.