Merge pull request #12659 from thalesmg/test-flaky-pulsar-r56-20240306

test(pulsar): fix flaky test
This commit is contained in:
Thales Macedo Garitezi 2024-03-06 15:29:01 -03:00 committed by GitHub
commit df3ebc5c56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 12 deletions

View File

@ -212,20 +212,25 @@ t_action(Config) ->
?assertEqual(ReqPayload, emqx_utils_json:decode(RespPayload)), ?assertEqual(ReqPayload, emqx_utils_json:decode(RespPayload)),
ok = emqtt:disconnect(C1), ok = emqtt:disconnect(C1),
InstanceId = instance_id(actions, Name), InstanceId = instance_id(actions, Name),
#{counters := Counters} = emqx_resource:get_metrics(InstanceId), ?retry(
100,
20,
?assertMatch(
#{
counters := #{
dropped := 0,
success := 1,
matched := 1,
failed := 0,
received := 0
}
},
emqx_resource:get_metrics(InstanceId)
)
),
ok = delete_action(Name), ok = delete_action(Name),
ActionsAfterDelete = emqx_bridge_v2:list(actions), ActionsAfterDelete = emqx_bridge_v2:list(actions),
?assertNot(lists:any(Any, ActionsAfterDelete), ActionsAfterDelete), ?assertNot(lists:any(Any, ActionsAfterDelete), ActionsAfterDelete),
?assertMatch(
#{
dropped := 0,
success := 1,
matched := 1,
failed := 0,
received := 0
},
Counters
),
ok. ok.
%%------------------------------------------------------------------------------ %%------------------------------------------------------------------------------
@ -292,7 +297,8 @@ pulsar_action(Config) ->
<<"pulsar_topic">> => ?config(pulsar_topic, Config) <<"pulsar_topic">> => ?config(pulsar_topic, Config)
}, },
<<"resource_opts">> => #{ <<"resource_opts">> => #{
<<"health_check_interval">> => <<"1s">> <<"health_check_interval">> => <<"1s">>,
<<"metrics_flush_interval">> => <<"300ms">>
} }
} }
} }