Skip to content

Commit 9e4c421

Browse files
committed
De-flake TestNRGCandidateDontStepdownDueToLeaderOfPreviousTerm
Signed-off-by: Neil Twigg <[email protected]>
1 parent 9266be8 commit 9e4c421

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/raft_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,13 @@ func TestNRGNoResetOnAppendEntryResponse(t *testing.T) {
865865
}
866866

867867
func TestNRGCandidateDontStepdownDueToLeaderOfPreviousTerm(t *testing.T) {
868+
// This test relies on nodes not hitting their election timer too often.
869+
origMinTimeout, origMaxTimeout, origHBInterval := minElectionTimeout, maxElectionTimeout, hbInterval
870+
minElectionTimeout, maxElectionTimeout, hbInterval = time.Second*5, time.Second*10, time.Second
871+
defer func() {
872+
minElectionTimeout, maxElectionTimeout, hbInterval = origMinTimeout, origMaxTimeout, origHBInterval
873+
}()
874+
868875
c := createJetStreamClusterExplicit(t, "R3S", 3)
869876
defer c.shutdown()
870877
c.waitOnLeader()

0 commit comments

Comments
 (0)