Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Octogonapus committed Aug 9, 2024
1 parent af79b52 commit b2ca426
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/interrupt_connection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
client_id1;
will = Will(topic1, AWS_MQTT_QOS_AT_LEAST_ONCE, "The client has gone offline!", false),
on_connection_interrupted = (conn, error_code) -> begin
@warn "connection interrupted" error_code
Threads.atomic_add!(interruptions, 1)
@warn "connection interrupted" error_code
end,
on_connection_resumed = (conn, return_code, session_present) -> begin
@info "connection resumed" return_code session_present
Threads.atomic_add!(resumes, 1)
@info "connection resumed" return_code session_present
end,
)
@test fetch(task) == Dict(:session_present => false)

# kill the MQTT connection
run(`sudo ss -K dport = 8883`)

wait_for(() -> resumes[] > 0)
wait_for(() -> resumes[] > 0, Timer(30))
@test interruptions[] == 1
@test resumes[] == 1

Expand Down

0 comments on commit b2ca426

Please sign in to comment.