Merge pull request #11461 from thalesmg/bridge-dryrun-flex-timeout-r52-20230816

fix(bridge): make dryrun health check timeout more malleable
This commit is contained in:
Thales Macedo Garitezi 2023-08-21 14:49:46 -03:00 committed by GitHub
commit bd5680db00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 3 deletions

View File

@ -207,7 +207,10 @@ fields(consumer_topic_mapping) ->
)}
];
fields("consumer_resource_opts") ->
ResourceFields = emqx_resource_schema:fields("creation_opts"),
ResourceFields =
emqx_resource_schema:create_opts(
[{health_check_interval, #{default => <<"30s">>}}]
),
SupportedFields = [
auto_restart_interval,
health_check_interval,

View File

@ -1,7 +1,7 @@
%% -*- mode: erlang -*-
{application, emqx_resource, [
{description, "Manager for all external resources"},
{vsn, "0.1.21"},
{vsn, "0.1.22"},
{registered, []},
{mod, {emqx_resource_app, []}},
{applications, [

View File

@ -179,7 +179,9 @@ create_dry_run(ResourceType, Config) ->
false -> #{}
end,
ok = emqx_resource_manager_sup:ensure_child(ResId, <<"dry_run">>, ResourceType, Config, Opts),
case wait_for_ready(ResId, 5000) of
HealthCheckInterval = maps:get(health_check_interval, Opts, ?HEALTHCHECK_INTERVAL),
Timeout = emqx_utils:clamp(HealthCheckInterval, 5_000, 60_000),
case wait_for_ready(ResId, Timeout) of
ok ->
remove(ResId);
{error, Reason} ->

View File

@ -47,6 +47,7 @@ fields("resource_opts") ->
fields("creation_opts") ->
create_opts([]).
-spec create_opts([{atom(), hocon_schema:field_schema_map()}]) -> [{atom(), hocon_schema:field()}].
create_opts(Overrides) ->
override(
[

View File

@ -0,0 +1 @@
Made the timeout for testing bridges connectivity follow more closely the configured health check timeout.