Skip to content

Commit

Permalink
NRG (2.11): De-flake TestNRGSwitchStateClearsQueues (#5691)
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
derekcollison authored Jul 23, 2024
2 parents 4b65ab5 + 8646888 commit 571d97a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions server/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,12 @@ func TestNRGSwitchStateClearsQueues(t *testing.T) {
rg := c.createMemRaftGroup("TEST", 3, newStateAdder)
rg.waitOnLeader()

sa := rg.leader().(*stateAdder)
n := sa.node().(*raft)

for i := 0; i < 10_000; i++ {
sa.proposeDelta(1)
}
rg.lockAll()
defer rg.unlockAll()

n.Lock()
defer n.Unlock()
n := rg.leader().node().(*raft)
n.prop.push(&Entry{})
n.resp.push(&appendEntryResponse{})

n.switchState(Follower)
require_Equal(t, n.prop.len(), 0)
Expand Down

0 comments on commit 571d97a

Please sign in to comment.