Skip to content

Commit

Permalink
test: add test for RestoreCommittedLogs with incompatible log store
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Oct 11, 2024
1 parent cfffcb5 commit 560c0b9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,21 @@ func TestRaft_RestoreCommittedLogs(t *testing.T) {
assert.LessOrEqual(t, commitIdx, lastIdx)
}

func TestRaft_RestoreCommittedLogs_IncompatibleLogStore(t *testing.T) {
// Make the cluster
conf := inmemConfig(t)
conf.TrailingLogs = 10
conf.RestoreCommittedLogs = true
opts := &MakeClusterOpts{
Peers: 1,
Bootstrap: true,
Conf: conf,
CommitTrackingLogs: false,
}
_, err := MakeClusterCustom(t, opts)
require.ErrorIs(t, err, ErrIncompatibleLogStore)
}

func TestRaft_SnapshotRestore_Progress(t *testing.T) {
// Make the cluster
conf := inmemConfig(t)
Expand Down

0 comments on commit 560c0b9

Please sign in to comment.