Dumb test
Can't test for slow not_present outside of simple unit test ... will be very rare event
This commit is contained in:
parent
19534122a2
commit
4e6c22d7e6
1 changed files with 7 additions and 2 deletions
|
@ -797,8 +797,11 @@ timed_sst_get(PID, Key, Hash) ->
|
|||
SW = os:timestamp(),
|
||||
R = leveled_sst:sst_get(PID, Key, Hash),
|
||||
T0 = timer:now_diff(os:timestamp(), SW),
|
||||
log_slowfetch(T0, R, PID, ?SLOW_FETCH).
|
||||
|
||||
log_slowfetch(T0, R, PID, FetchTolerance) ->
|
||||
case {T0, R} of
|
||||
{T, R} when T < ?SLOW_FETCH ->
|
||||
{T, R} when T < FetchTolerance ->
|
||||
R;
|
||||
{T, not_present} ->
|
||||
leveled_log:log("PC016", [PID, T, not_present]),
|
||||
|
@ -808,7 +811,6 @@ timed_sst_get(PID, Key, Hash) ->
|
|||
R
|
||||
end.
|
||||
|
||||
|
||||
compare_to_sqn(Obj, SQN) ->
|
||||
case Obj of
|
||||
not_present ->
|
||||
|
@ -1418,6 +1420,9 @@ create_file_test() ->
|
|||
{ok, Bin} = file:read_file("../test/new_file.sst.discarded"),
|
||||
?assertMatch("hello", binary_to_term(Bin)).
|
||||
|
||||
slow_fetch_test() ->
|
||||
?assertMatch(not_present, log_slowfetch(2, not_present, "fake", 1)).
|
||||
|
||||
checkready(Pid) ->
|
||||
try
|
||||
leveled_sst:sst_checkready(Pid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue