Skip to content

Commit 7c0bec1

Browse files
committed
De-flake TestNRGSimpleElection
Signed-off-by: Neil Twigg <[email protected]>
1 parent 9e4c421 commit 7c0bec1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/raft_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ func TestNRGSimpleElection(t *testing.T) {
341341
re := decodeVoteResponse(msg.Data)
342342
require_True(t, re != nil)
343343

344+
// Ignore old vote responses that could be in-flight.
345+
if re.term < vr.term {
346+
i--
347+
continue
348+
}
349+
344350
// The vote should have been granted.
345351
require_Equal(t, re.granted, true)
346352

0 commit comments

Comments
 (0)