Browse Source

raft: fix godoc in tests

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
Gyuho Lee 7 years ago
parent
commit
b7ed4165ea
1 changed files with 2 additions and 3 deletions
  1. 2 3
      raft/raft_test.go

+ 2 - 3
raft/raft_test.go

@@ -1216,8 +1216,7 @@ func TestProposal(t *testing.T) {
 	for j, tt := range tests {
 	for j, tt := range tests {
 		send := func(m pb.Message) {
 		send := func(m pb.Message) {
 			defer func() {
 			defer func() {
-				// only recover is we expect it to panic so
-				// panics we don't expect go up.
+				// only recover if we expect it to panic (success==false)
 				if !tt.success {
 				if !tt.success {
 					e := recover()
 					e := recover()
 					if e != nil {
 					if e != nil {
@@ -1230,7 +1229,7 @@ func TestProposal(t *testing.T) {
 
 
 		data := []byte("somedata")
 		data := []byte("somedata")
 
 
-		// promote 0 the leader
+		// promote 1 to become leader
 		send(pb.Message{From: 1, To: 1, Type: pb.MsgHup})
 		send(pb.Message{From: 1, To: 1, Type: pb.MsgHup})
 		send(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{Data: data}}})
 		send(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{Data: data}}})