From fe0325fce7d7b9dbc5ddca8638cdfeef6c8419ca Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 12 Nov 2014 11:05:25 -0800 Subject: [PATCH] raft: add comment string for TestNodeStart --- raft/node.go | 2 +- raft/node_test.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/raft/node.go b/raft/node.go index 003db937f..b4e2e6f51 100644 --- a/raft/node.go +++ b/raft/node.go @@ -143,7 +143,7 @@ type Peer struct { // StartNode returns a new Node given a unique raft id, a list of raft peers, and // the election and heartbeat timeouts in units of ticks. -// It also builds ConfChangeAddNode entry for each peer and puts them at the head of the log. +// It appends a ConfChangeAddNode entry for each given peer to the initial log. func StartNode(id uint64, peers []Peer, election, heartbeat int) Node { n := newNode() r := newRaft(id, nil, election, heartbeat) diff --git a/raft/node_test.go b/raft/node_test.go index e25513f67..a101e230a 100644 --- a/raft/node_test.go +++ b/raft/node_test.go @@ -161,7 +161,10 @@ func TestReadyContainUpdates(t *testing.T) { } } -func TestNode(t *testing.T) { +// TestNodeStart ensures that a node can be started correctly. The node should +// start with correct configuration change entries, and can accept and commit +// proposals. +func TestNodeStart(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel()