Skip to content

Commit

Permalink
test reconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwro committed Oct 2, 2023
1 parent b20a291 commit 32b3aeb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/connection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ end
unsubscribe(sub)
sleep(0.1)
end

@testset "Should reconnect on malformed msg" begin
nc = NATS.connect()
con_msg = NATS.from_kwargs(NATS.Connect, NATS.DEFAULT_CONNECT_ARGS, (protocol=100,))
NATS.send(nc, con_msg)
sleep(5)
@test nc.status == NATS.CONNECTED
end

@testset "Should reconnect on outbox closed" begin
nc = NATS.connect()
close(nc.outbox)
sleep(5)
@test nc.status == NATS.CONNECTED
end

0 comments on commit 32b3aeb

Please sign in to comment.