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).
|
||||
|
||||
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(_) ->
|
||||
{ok, _} = emqx_resource:create_local(
|
||||
?ID,
|
||||
|
|
|
@ -61,6 +61,7 @@ on_query(_InstId, get_state_failed, AfterQuery, State) ->
|
|||
State.
|
||||
|
||||
on_health_check(_InstId, State = #{pid := Pid}) ->
|
||||
timer:sleep(300),
|
||||
case is_process_alive(Pid) of
|
||||
true -> {ok, State};
|
||||
false -> {error, dead, State}
|
||||
|
|
Loading…
Reference in New Issue