goraft / raft

UNMAINTAINED: A Go implementation of the Raft distributed consensus protocol.
MIT License
2.43k stars 480 forks source link

Add snapshot test coverage #157

Closed benbjohnson closed 10 years ago

benbjohnson commented 10 years ago

Added snapshot test coverage, cleaned up some code aesthetics, and added state machine mocking.

/cc: @philips @xiangli-cmu

benbjohnson commented 10 years ago

@philips @xiangli-cmu I removed Travis builds from Raft because they're constantly failing. My guess is that the servers are overloaded which causes pauses which fails the liveness tests. The Drone builds are running fine:

https://drone.io/github.com/goraft/raft/8

benbjohnson commented 10 years ago

Also, Coveralls coverage should update soon. Not sure why it takes so long to calculate the coverage:

https://coveralls.io/builds/455791

philips commented 10 years ago

The tests look good. My problems are with the code as it was before this PR. If you want to merge this as-is it looks good to me. The other stuff can be cleaned up in a subsequent PR.

benbjohnson commented 10 years ago

@philips I agree that the naming is confusion and adding the lock will let us remove that. I wanted to limit the scope of this PR to adding test coverage so we could know if those changes will break anything. Test coverage got a +5% bump. woohoo!