{"action":"opened","issue":{"url":"https://api.github.com/repos/Hoverbear/raft/issues/12","labels_url":"https://api.github.com/repos/Hoverbear/raft/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/Hoverbear/raft/issues/12/comments","events_url":"https://api.github.com/repos/Hoverbear/raft/issues/12/events","html_url":"https://github.com/Hoverbear/raft/issues/12","id":60031724,"number":12,"title":"Add comprehensive tests, especially for fail recovery","user":{"login":"foodhype","id":2672812,"avatar_url":"https://avatars.githubusercontent.com/u/2672812?v=3","gravatar_id":"","url":"https://api.github.com/users/foodhype","html_url":"https://github.com/foodhype","followers_url":"https://api.github.com/users/foodhype/followers","following_url":"https://api.github.com/users/foodhype/following{/other_user}","gists_url":"https://api.github.com/users/foodhype/gists{/gist_id}","starred_url":"https://api.github.com/users/foodhype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foodhype/subscriptions","organizations_url":"https://api.github.com/users/foodhype/orgs","repos_url":"https://api.github.com/users/foodhype/repos","events_url":"https://api.github.com/users/foodhype/events{/privacy}","received_events_url":"https://api.github.com/users/foodhype/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-05T23:07:23Z","updated_at":"2015-03-05T23:07:23Z","closed_at":null,"body":"First, I suggest breaking up the current basic_test into many tests.\r\n\r\nSecond, I suggest having a test that (1) completely kills the process on which a node is running; (2) restarts a completely new process (with no knowledge from other processes) to replace the dead process; (3) blocks issuing any new commands until some stabilization period has passed; and (4) asserts that the new node is able to get back up to speed with the old state on its own. (Leader recovery and follower recovery are separate cases, obviously.)\r\n\r\nRunning the nodes on separate processes will guarantee that no state is shared between nodes except through asynchronous message passing. Killing the process completely and abruptly will allow testing for edge cases that occur during real machine failures, such as reusing old sockets, cleaning up resources, recovering state from scratch (for the recovering process), and failure detection/handling (by neighbor processes).\r\n\r\nCommon methods of testing include having a master spawn processes, issue a sequence of commands, stabilize, and then kill the process completely. Other methods include having a time bomb mechanism whereby the master server commands processes to immediately crash themselves after performing a certain number of commands, which allows more fine-grained scenario testing."}}