cockroachdb / cockroachdb/cockroach
Update legacy raft tests
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
This issue page tracks legacy Raft tests that no longer serve their purpose due to updated (test) helper functions.
The following is an example.
https://github.com/cockroachdb/cockroach/blob/91b58a15c1453f2c6f5f559cfb92029e8af84227/pkg/raft/storage.go#L301-L317
https://github.com/cockroachdb/cockroach/blob/6fed631ec9b524db10100c9748b596d4cb421f6d/pkg/raft/raft_paper_test.go#L664-L676
Since we treat index 0 as a special boundary index. When we try to append log slices when starting at index 0, it errors compacted and the error is ignored.
The test proceeds and passes, with each node not having any init raft log. which renders the test useless.
This is just one example, but there could be many other instances of similar bugs. A lot of those tests guard for edge cases of raft.
Therefore, if encountered, we should aim to try to fix them to avoid potential disasters.
Jira issue: CRDB-49003
Contributor guide
Assessment
This issue has not been assessed yet.