{"action":"opened","issue":{"url":"https://api.github.com/repos/habitat-sh/habitat/issues/5898","repository_url":"https://api.github.com/repos/habitat-sh/habitat","labels_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5898/labels{/name}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5898/comments","events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5898/events","html_url":"https://github.com/habitat-sh/habitat/issues/5898","id":385922973,"node_id":"MDU6SXNzdWUzODU5MjI5NzM=","number":5898,"title":"Election: add unit tests for core algorithm","user":{"login":"baumanj","id":5906042,"node_id":"MDQ6VXNlcjU5MDYwNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/5906042?v=4","gravatar_id":"","url":"https://api.github.com/users/baumanj","html_url":"https://github.com/baumanj","followers_url":"https://api.github.com/users/baumanj/followers","following_url":"https://api.github.com/users/baumanj/following{/other_user}","gists_url":"https://api.github.com/users/baumanj/gists{/gist_id}","starred_url":"https://api.github.com/users/baumanj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baumanj/subscriptions","organizations_url":"https://api.github.com/users/baumanj/orgs","repos_url":"https://api.github.com/users/baumanj/repos","events_url":"https://api.github.com/users/baumanj/events{/privacy}","received_events_url":"https://api.github.com/users/baumanj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/habitat-sh/habitat/milestones/16","html_url":"https://github.com/habitat-sh/habitat/milestone/16","labels_url":"https://api.github.com/repos/habitat-sh/habitat/milestones/16/labels","id":3408792,"node_id":"MDk6TWlsZXN0b25lMzQwODc5Mg==","number":16,"title":"1.0 Supervisor","description":"Important bugs that need to be fixed and features that need to be added in order to have a 1.0 Supervisor.","creator":{"login":"christophermaier","id":207178,"node_id":"MDQ6VXNlcjIwNzE3OA==","avatar_url":"https://avatars2.githubusercontent.com/u/207178?v=4","gravatar_id":"","url":"https://api.github.com/users/christophermaier","html_url":"https://github.com/christophermaier","followers_url":"https://api.github.com/users/christophermaier/followers","following_url":"https://api.github.com/users/christophermaier/following{/other_user}","gists_url":"https://api.github.com/users/christophermaier/gists{/gist_id}","starred_url":"https://api.github.com/users/christophermaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophermaier/subscriptions","organizations_url":"https://api.github.com/users/christophermaier/orgs","repos_url":"https://api.github.com/users/christophermaier/repos","events_url":"https://api.github.com/users/christophermaier/events{/privacy}","received_events_url":"https://api.github.com/users/christophermaier/received_events","type":"User","site_admin":false},"open_issues":74,"closed_issues":27,"state":"open","created_at":"2018-06-07T19:14:00Z","updated_at":"2018-11-29T20:57:32Z","due_on":"2018-10-05T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-11-29T20:57:32Z","updated_at":"2018-11-29T20:57:32Z","closed_at":null,"author_association":"MEMBER","body":"Exhaustive testing using end-to-end or integration tests is time and resource intensive. However, the core elections algorithm is contained in just a handful of functions:\n- [`start_election`](https://github.com/habitat-sh/habitat/blob/master/components/butterfly/src/server/mod.rs#L875)\n- [`instert_election`](https://github.com/habitat-sh/habitat/blob/master/components/butterfly/src/server/mod.rs#L1009)\n- [`restart_elections`](https://github.com/habitat-sh/habitat/blob/master/components/butterfly/src/server/mod.rs#L987)\n- [`merge`](https://github.com/habitat-sh/habitat/blob/master/components/butterfly/src/rumor/election.rs#L177)\n\nCreating testable, purely functional interfaces (as with [`elections_to_restart_impl`](https://github.com/habitat-sh/habitat/blob/master/components/butterfly/src/server/mod.rs#L923)) can allow for the creation of efficient tests of a wide variety of scenarios to help validate the algorithm in a variety of scenarios that are hard to achieve with other types of testing.\n"}}
{"actor":{"display_login":"baumanj"}}