fix(bridge): make dryrun health check timeout more malleable
@@ -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,
@@ -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, [
@@ -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} ->
@@ -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(
[
@@ -0,0 +1 @@
+Made the timeout for testing bridges connectivity follow more closely the configured health check timeout.