Onyx-Protocol / Onyx

Onyx

Home Page:https://Onyx.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

net/raft: unit test raft snapshots

jbowens opened this issue · comments

Currently, we don't have any unit tests covering raft snapshots. We only trigger snapshots every 10,000 raft entries, so most (all?) of our tests never trigger a snapshot. With the test State implementation from #1336, we can write a net/raft unit test that triggers snapshots more frequently. This kind of unit test could detect a regression of the crash from #1284.

snapCount and nSnapCatchupEntries are constants right now. We might need to copy those values into the Service struct so that the unit test can configure them with very low values to force frequent snapshots.