Merge pull request #10068 from thalesmg/fix-flaky-mqtt-bridge-test

test: fix flaky mqtt bridge test
This commit is contained in:
Thales Macedo Garitezi 2023-03-06 13:06:37 -03:00 committed by GitHub
commit 2fa4e8e21a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 6 deletions

View File

@ -359,9 +359,13 @@ t_mqtt_conn_bridge_egress(_) ->
?assertMatch(<<ResourceID:Size/binary, _/binary>>, Msg#message.from), ?assertMatch(<<ResourceID:Size/binary, _/binary>>, Msg#message.from),
%% verify the metrics of the bridge %% verify the metrics of the bridge
?assertMetrics( ?retry(
#{<<"matched">> := 1, <<"success">> := 1, <<"failed">> := 0}, _Interval = 200,
BridgeIDEgress _Attempts = 5,
?assertMetrics(
#{<<"matched">> := 1, <<"success">> := 1, <<"failed">> := 0},
BridgeIDEgress
)
), ),
%% delete the bridge %% delete the bridge
@ -402,9 +406,13 @@ t_mqtt_conn_bridge_egress_no_payload_template(_) ->
?assertMatch(#{<<"payload">> := Payload}, jsx:decode(Msg#message.payload)), ?assertMatch(#{<<"payload">> := Payload}, jsx:decode(Msg#message.payload)),
%% verify the metrics of the bridge %% verify the metrics of the bridge
?assertMetrics( ?retry(
#{<<"matched">> := 1, <<"success">> := 1, <<"failed">> := 0}, _Interval = 200,
BridgeIDEgress _Attempts = 5,
?assertMetrics(
#{<<"matched">> := 1, <<"success">> := 1, <<"failed">> := 0},
BridgeIDEgress
)
), ),
%% delete the bridge %% delete the bridge