Merge pull request #10796 from thalesmg/fix-flaky-ocsp-test-v50
test: fix flaky ocsp test setup (v5.0)
This commit is contained in:
commit
c53c24cd04
|
@ -165,6 +165,7 @@ init_per_testcase(_TestCase, Config) ->
|
||||||
{ok, {{"HTTP/1.0", 200, 'OK'}, [], <<"ocsp response">>}}
|
{ok, {{"HTTP/1.0", 200, 'OK'}, [], <<"ocsp response">>}}
|
||||||
end
|
end
|
||||||
),
|
),
|
||||||
|
snabbkaffe:start_trace(),
|
||||||
_Heir = spawn_dummy_heir(),
|
_Heir = spawn_dummy_heir(),
|
||||||
{ok, CachePid} = emqx_ocsp_cache:start_link(),
|
{ok, CachePid} = emqx_ocsp_cache:start_link(),
|
||||||
DataDir = ?config(data_dir, Config),
|
DataDir = ?config(data_dir, Config),
|
||||||
|
@ -187,7 +188,6 @@ init_per_testcase(_TestCase, Config) ->
|
||||||
ConfBin = emqx_utils_maps:binary_key_map(Conf),
|
ConfBin = emqx_utils_maps:binary_key_map(Conf),
|
||||||
hocon_tconf:check_plain(emqx_schema, ConfBin, #{required => false, atom_keys => false}),
|
hocon_tconf:check_plain(emqx_schema, ConfBin, #{required => false, atom_keys => false}),
|
||||||
emqx_config:put_listener_conf(Type, Name, [], ListenerOpts),
|
emqx_config:put_listener_conf(Type, Name, [], ListenerOpts),
|
||||||
snabbkaffe:start_trace(),
|
|
||||||
[
|
[
|
||||||
{cache_pid, CachePid}
|
{cache_pid, CachePid}
|
||||||
| Config
|
| Config
|
||||||
|
@ -231,12 +231,19 @@ end_per_testcase(_TestCase, Config) ->
|
||||||
%% In some tests, we don't start the full supervision tree, so we need
|
%% In some tests, we don't start the full supervision tree, so we need
|
||||||
%% this dummy process.
|
%% this dummy process.
|
||||||
spawn_dummy_heir() ->
|
spawn_dummy_heir() ->
|
||||||
spawn_link(fun() ->
|
{_, {ok, _}} =
|
||||||
true = register(emqx_kernel_sup, self()),
|
?wait_async_action(
|
||||||
receive
|
spawn_link(fun() ->
|
||||||
stop -> ok
|
true = register(emqx_kernel_sup, self()),
|
||||||
end
|
?tp(heir_name_registered, #{}),
|
||||||
end).
|
receive
|
||||||
|
stop -> ok
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
#{?snk_kind := heir_name_registered},
|
||||||
|
1_000
|
||||||
|
),
|
||||||
|
ok.
|
||||||
|
|
||||||
does_module_exist(Mod) ->
|
does_module_exist(Mod) ->
|
||||||
case erlang:module_loaded(Mod) of
|
case erlang:module_loaded(Mod) of
|
||||||
|
|
Loading…
Reference in New Issue