test(emqx_resource_health_check): add more test to
health_check_timeout_checker
This commit is contained in:
parent
cb9f14f658
commit
d312f315ac
|
@ -140,6 +140,16 @@ t_query(_) ->
|
||||||
|
|
||||||
ok = emqx_resource:remove_local(?ID).
|
ok = emqx_resource:remove_local(?ID).
|
||||||
|
|
||||||
|
t_healthy_timeout(_) ->
|
||||||
|
{ok, _} = emqx_resource:create_local(
|
||||||
|
?ID,
|
||||||
|
?TEST_RESOURCE,
|
||||||
|
#{name => <<"test_resource">>},
|
||||||
|
#{async_create => true, health_check_timeout => 200}),
|
||||||
|
timer:sleep(500),
|
||||||
|
|
||||||
|
ok = emqx_resource:remove_local(?ID).
|
||||||
|
|
||||||
t_healthy(_) ->
|
t_healthy(_) ->
|
||||||
{ok, _} = emqx_resource:create_local(
|
{ok, _} = emqx_resource:create_local(
|
||||||
?ID,
|
?ID,
|
||||||
|
|
|
@ -61,6 +61,7 @@ on_query(_InstId, get_state_failed, AfterQuery, State) ->
|
||||||
State.
|
State.
|
||||||
|
|
||||||
on_health_check(_InstId, State = #{pid := Pid}) ->
|
on_health_check(_InstId, State = #{pid := Pid}) ->
|
||||||
|
timer:sleep(300),
|
||||||
case is_process_alive(Pid) of
|
case is_process_alive(Pid) of
|
||||||
true -> {ok, State};
|
true -> {ok, State};
|
||||||
false -> {error, dead, State}
|
false -> {error, dead, State}
|
||||||
|
|
Loading…
Reference in New Issue