Skip to content

Commit

Permalink
raft: fix godoc in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
  • Loading branch information
gyuho committed Oct 25, 2018
1 parent 965ba5c commit b7ed416
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions raft/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,7 @@ func TestProposal(t *testing.T) {
for j, tt := range tests {
send := func(m pb.Message) {
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 {
e := recover()
if e != nil {
Expand All @@ -1230,7 +1229,7 @@ func TestProposal(t *testing.T) {

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.MsgProp, Entries: []pb.Entry{{Data: data}}})

Expand Down

0 comments on commit b7ed416

Please sign in to comment.