Skip to content

Commit

Permalink
Fix for flapping test
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Apr 3, 2023
1 parent 59175c4 commit 7d3ec51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/jetstream_cluster_3_test.go
Expand Up @@ -2242,14 +2242,15 @@ func TestJetStreamClusterMemLeaderRestart(t *testing.T) {

// Make sure that we have a META leader (there can always be a re-election)
c.waitOnLeader()
c.waitOnStreamLeader(globalAccountName, "foo")

// Should still have quorum and a new leader
checkFor(t, time.Second, 200*time.Millisecond, func() error {
checkFor(t, 5*time.Second, 200*time.Millisecond, func() error {
osi, err = jsc.StreamInfo("foo")
if err != nil {
return fmt.Errorf("expected healthy stream asset, got %s", err.Error())
}
if osi.Cluster.Leader == "" {
if osi.Cluster.Leader == _EMPTY_ {
return fmt.Errorf("expected healthy stream asset with new leader")
}
if osi.State.Msgs != uint64(toSend) {
Expand Down

0 comments on commit 7d3ec51

Please sign in to comment.