old-raft-rs icon indicating copy to clipboard operation
old-raft-rs copied to clipboard

Test Harness

Open Hoverbear opened this issue 9 years ago • 1 comments

It may be useful to have the debug builds of Raft feature a testing harness. This could be used to simulate failure, delays, etc. Up in the air about what it might even look like, but I assume we could use some #[cfg(feature = "harness")] or some manner or speaking.

Possible features:

  • Pause (and come back again in n seconds)
  • Delay (Simulate a delay)
  • Partition (Into a subgroup)

Hoverbear avatar Aug 04 '15 23:08 Hoverbear

#87 first. Notably: No event loop required in simulation without networking. Delays can be done with thread sleeps or mio. Handling the order between simulated peers - they could be talking via a channel and so all nodes can be walked at the same time flushing all queues (including those newly added due to actions).

Partitioning would be to just split the available peers per simulation and run them independently. Partition and merge functions in the simulator will need to cover this.

EDIT: The most important thing to note here is that the tests would be deterministic without I/O or platform specific code. With no side affects - the tests become proofs.

WildCryptoFox avatar Aug 07 '15 02:08 WildCryptoFox