mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
@@ -3946,6 +3946,15 @@ func TestJetStreamConsumerMaxDeliveryAndServerRestart(t *testing.T) {
|
||||
s = RunJetStreamServerOnPort(port, sd)
|
||||
}
|
||||
|
||||
waitForClientReconnect := func() {
|
||||
checkFor(t, 2500*time.Millisecond, 5*time.Millisecond, func() error {
|
||||
if !nc.IsConnected() {
|
||||
return fmt.Errorf("Not connected")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Restart.
|
||||
restartServer()
|
||||
defer s.Shutdown()
|
||||
@@ -3953,12 +3962,7 @@ func TestJetStreamConsumerMaxDeliveryAndServerRestart(t *testing.T) {
|
||||
checkNumMsgs(2)
|
||||
|
||||
// Wait for client to be reconnected.
|
||||
checkFor(t, 2500*time.Millisecond, 5*time.Millisecond, func() error {
|
||||
if !nc.IsConnected() {
|
||||
return fmt.Errorf("Not connected")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
waitForClientReconnect()
|
||||
|
||||
// Once we are here send third order.
|
||||
sendStreamMsg(t, nc, mname, "order-3")
|
||||
@@ -3970,6 +3974,9 @@ func TestJetStreamConsumerMaxDeliveryAndServerRestart(t *testing.T) {
|
||||
|
||||
checkNumMsgs(3)
|
||||
|
||||
// Wait for client to be reconnected.
|
||||
waitForClientReconnect()
|
||||
|
||||
// Now we should have max times three on our sub.
|
||||
checkSubPending(max * 3)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user