Merge pull request #11262 from thalesmg/fix-gcp-consumer-hc-20230712-master
fix(gcp_pubsub_consumer): fail health check when there are no workers
This commit is contained in:
commit
0dff428efb
|
@ -249,6 +249,8 @@ check_workers(InstanceId, Client) ->
|
||||||
#{return_values => true}
|
#{return_values => true}
|
||||||
)
|
)
|
||||||
of
|
of
|
||||||
|
{ok, []} ->
|
||||||
|
connecting;
|
||||||
{ok, Values} ->
|
{ok, Values} ->
|
||||||
AllOk = lists:all(fun(S) -> S =:= subscription_ok end, Values),
|
AllOk = lists:all(fun(S) -> S =:= subscription_ok end, Values),
|
||||||
case AllOk of
|
case AllOk of
|
||||||
|
|
|
@ -1004,7 +1004,27 @@ t_bridge_rule_action_source(Config) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
t_on_get_status(Config) ->
|
t_on_get_status(Config) ->
|
||||||
|
ResourceId = resource_id(Config),
|
||||||
emqx_bridge_testlib:t_on_get_status(Config, #{failure_status => connecting}),
|
emqx_bridge_testlib:t_on_get_status(Config, #{failure_status => connecting}),
|
||||||
|
%% no workers alive
|
||||||
|
?retry(
|
||||||
|
_Interval0 = 200,
|
||||||
|
_NAttempts0 = 20,
|
||||||
|
?assertMatch({ok, connected}, emqx_resource_manager:health_check(ResourceId))
|
||||||
|
),
|
||||||
|
WorkerPids = get_pull_worker_pids(Config),
|
||||||
|
emqx_utils:pmap(
|
||||||
|
fun(Pid) ->
|
||||||
|
Ref = monitor(process, Pid),
|
||||||
|
exit(Pid, kill),
|
||||||
|
receive
|
||||||
|
{'DOWN', Ref, process, Pid, killed} ->
|
||||||
|
ok
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
WorkerPids
|
||||||
|
),
|
||||||
|
?assertMatch({ok, connecting}, emqx_resource_manager:health_check(ResourceId)),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
t_create_via_http_api(_Config) ->
|
t_create_via_http_api(_Config) ->
|
||||||
|
|
Loading…
Reference in New Issue