Browse Source

raft: refine comment for doc and removed list tests

Yicheng Qin 11 years ago
parent
commit
182c8316e1
2 changed files with 6 additions and 6 deletions
  1. 1 1
      raft/doc.go
  2. 5 5
      raft/raft_test.go

+ 1 - 1
raft/doc.go

@@ -75,7 +75,7 @@ raftpb.EntryConfChange will be returned. You should apply it to node through:
 	cc.Unmarshal(data)
 	cc.Unmarshal(data)
 	n.ApplyConfChange(cc)
 	n.ApplyConfChange(cc)
 
 
-Note: One ID represents one unique node in a cluster. A given ID MUST be used
+Note: An ID represents a unique node in a cluster. A given ID MUST be used
 only once even if the old node has been removed.
 only once even if the old node has been removed.
 
 
 */
 */

+ 5 - 5
raft/raft_test.go

@@ -986,7 +986,7 @@ func TestRecoverDoublePendingConfig(t *testing.T) {
 	}()
 	}()
 }
 }
 
 
-// TestAddNode tests that addNode could update pendingConf and peer list correctly.
+// TestAddNode tests that addNode could update pendingConf and nodes correctly.
 func TestAddNode(t *testing.T) {
 func TestAddNode(t *testing.T) {
 	r := newRaft(1, []int64{1}, 0, 0)
 	r := newRaft(1, []int64{1}, 0, 0)
 	r.pendingConf = true
 	r.pendingConf = true
@@ -1002,8 +1002,8 @@ func TestAddNode(t *testing.T) {
 	}
 	}
 }
 }
 
 
-// TestRemoveNode tests that removeNode could update pendingConf, peer list,
-// removed correctly.
+// TestRemoveNode tests that removeNode could update pendingConf, nodes and
+// and removed list correctly.
 func TestRemoveNode(t *testing.T) {
 func TestRemoveNode(t *testing.T) {
 	r := newRaft(1, []int64{1, 2}, 0, 0)
 	r := newRaft(1, []int64{1, 2}, 0, 0)
 	r.pendingConf = true
 	r.pendingConf = true
@@ -1021,8 +1021,8 @@ func TestRemoveNode(t *testing.T) {
 	}
 	}
 }
 }
 
 
-// TestRecvMsgDenied tests that state machine sets removed when handling
-// msgDenied, and does not pass it to the actual stepX function.
+// TestRecvMsgDenied tests that state machine sets the removed list when
+// handling msgDenied, and does not pass it to the actual stepX function.
 func TestRecvMsgDenied(t *testing.T) {
 func TestRecvMsgDenied(t *testing.T) {
 	called := false
 	called := false
 	fakeStep := func(r *raft, m pb.Message) {
 	fakeStep := func(r *raft, m pb.Message) {