From 05966e33939ed50cc33d369cdb4565610113cad1 Mon Sep 17 00:00:00 2001 From: Jakub Wronowski Date: Fri, 6 Oct 2023 16:20:16 +0200 Subject: [PATCH] test disconnect --- test/chaos.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/chaos.jl b/test/chaos.jl index b68dc2dd..041e2367 100644 --- a/test/chaos.jl +++ b/test/chaos.jl @@ -212,3 +212,10 @@ end unsubscribe(sub) @info "Published: $(published_count.value), received: $(received_count.value)." end + +@testset "Disconnecting when retries exhausted." begin + nc = NATS.connect(;default = false, reconnect_delays = []) + @test restart_nats_server() == 0 + sleep(2) + @test nc.status == NATS.DISCONNECTED +end