Improve test error ouput.

This commit is contained in:
Daniil Fedotov 2018-01-29 18:33:46 +00:00
parent 2d62b5490a
commit 9b343894c1
2 changed files with 14 additions and 2 deletions

View File

@ -15,7 +15,7 @@
%%
-module(rabbit_auth_cache_ets_segmented).
-behaviour(gen_server2).
-behaviour(gen_server).
-behaviour(rabbit_auth_cache).
-export([start_link/1,

View File

@ -166,7 +166,19 @@ random_timing(Config, MaxTTL, Parallel) ->
ok = AuthCacheModule:put(Key, Value, TTL),
case AuthCacheModule:get(Key) of
{ok, Value} -> ok;
Other -> error({Other, Value})
Other ->
case AuthCacheModule of
rabbit_auth_cache_ets_segmented ->
State = sys:get_state(AuthCacheModule),
Data = case State of
{state, Segments, _, _} when is_list(Segments) ->
[ets:tab2list(Segment) || {_, Segment} <- Segments];
_ -> []
end,
error({Other, Value, State, Data});
_ ->
error({Other, Value})
end
end,
% expiry error
timer:sleep(TTL + 40),