test: fix flaky mqtt bridge test
Sometimes, this test fails because the metrics are still in the inflight phase.
This commit is contained in:
parent
be3fd24019
commit
8fbb948b6f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue