test: flaky audit log test
This commit is contained in:
parent
96d21d4dbe
commit
d8796ea985
|
@ -208,6 +208,8 @@ t_cli(_Config) ->
|
||||||
|
|
||||||
t_max_size(_Config) ->
|
t_max_size(_Config) ->
|
||||||
{ok, _} = emqx:update_config([log, audit, max_filter_size], 999),
|
{ok, _} = emqx:update_config([log, audit, max_filter_size], 999),
|
||||||
|
%% Make sure this process is using latest max_filter_size.
|
||||||
|
?assertEqual(ignore, gen_server:call(emqx_audit, whatever)),
|
||||||
SizeFun =
|
SizeFun =
|
||||||
fun() ->
|
fun() ->
|
||||||
AuditPath = emqx_mgmt_api_test_util:api_path(["audit"]),
|
AuditPath = emqx_mgmt_api_test_util:api_path(["audit"]),
|
||||||
|
@ -297,6 +299,9 @@ wait_for_dirty_write_log_done(Prev, RemainMs) ->
|
||||||
SleepMs = 100,
|
SleepMs = 100,
|
||||||
ct:sleep(SleepMs),
|
ct:sleep(SleepMs),
|
||||||
case mnesia:table_info(emqx_audit, size) of
|
case mnesia:table_info(emqx_audit, size) of
|
||||||
Prev -> Prev;
|
Prev ->
|
||||||
New -> wait_for_dirty_write_log_done(New, RemainMs - SleepMs)
|
ct:sleep(SleepMs * 2),
|
||||||
|
Prev;
|
||||||
|
New ->
|
||||||
|
wait_for_dirty_write_log_done(New, RemainMs - SleepMs)
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue