-
Notifications
You must be signed in to change notification settings - Fork 230
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This is an umbrella issue for all kinds of unit-test improvements. Unit-tests in this repository are significantly outdated, and need a revamp. For example:
Examples of things to fix/improve:
- Fix incorrect initialization of nodes, make a standard way to do this. Some tests change
RawNode / raftstructs arbitrarily, which breaks internal invariants and makes tests prone to false failures on any change. This necessitates PR authors to spend time debugging and fixing incorrect tests. - Eliminate boilerplate.
- For example, all assertions should use
require/assertpackages. Revisit tests #146 (comment)
- For example, all assertions should use
- Introduce helpers, to eliminate more boilerplate.
- For example, entry slices don't need to be copy-pasted many times, and can be generated with a simple function. tests: add helpers for generating entry slices #147
- Introduce test-only invariant checks that happen transparently in all tests. An example invariant:
r.Term >= r.raftLog.lastTerm(). Tests that manipulateRawNodestructs directly may accidentally break invariants, and end up testing arbitrary behaviour rather than real one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request