diff --git a/test/interrupt_connection.jl b/test/interrupt_connection.jl index d6c9e5c..5f51971 100644 --- a/test/interrupt_connection.jl +++ b/test/interrupt_connection.jl @@ -17,12 +17,12 @@ 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) @@ -30,7 +30,7 @@ # 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