test: fix flaky test
This commit is contained in:
parent
30a227bd38
commit
478fcc6ffd
|
@ -953,18 +953,17 @@ t_mqtt_conn_bridge_egress_reconnect(_) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
assert_mqtt_msg_received(Topic, Payload) ->
|
assert_mqtt_msg_received(Topic, Payload) ->
|
||||||
?assert(
|
ct:pal("checking if ~p has been received on ~p", [Payload, Topic]),
|
||||||
receive
|
receive
|
||||||
{deliver, Topic, #message{payload = Payload}} ->
|
{deliver, Topic, #message{payload = Payload}} ->
|
||||||
ct:pal("Got mqtt message: ~p on topic ~p", [Payload, Topic]),
|
ct:pal("Got mqtt message: ~p on topic ~p", [Payload, Topic]),
|
||||||
true;
|
ok;
|
||||||
Msg ->
|
Msg ->
|
||||||
ct:pal("Unexpected Msg: ~p", [Msg]),
|
ct:pal("Unexpected Msg: ~p", [Msg]),
|
||||||
false
|
assert_mqtt_msg_received(Topic, Payload)
|
||||||
after 100 ->
|
after 100 ->
|
||||||
false
|
ct:fail("timeout waiting for ~p on topic ~p", [Payload, Topic])
|
||||||
end
|
end.
|
||||||
).
|
|
||||||
|
|
||||||
request(Method, Url, Body) ->
|
request(Method, Url, Body) ->
|
||||||
request(<<"connector_admin">>, Method, Url, Body).
|
request(<<"connector_admin">>, Method, Url, Body).
|
||||||
|
|
Loading…
Reference in New Issue