Add test - large seglist

This commit is contained in:
Martin Sumner 2018-11-07 21:35:21 +00:00
parent ea7aa3086d
commit 2afb160a12

View file

@ -213,13 +213,31 @@ basic_riak_tester(Bucket, KeyCount) ->
{HeadFoldFun, []}, {HeadFoldFun, []},
true, false, true, false,
SegList), SegList),
SW_SL0 = os:timestamp(),
KLBySeg = HeadR(), KLBySeg = HeadR(),
io:format("SegList Headfold returned ~w heads~n", [length(KLBySeg)]), io:format("SegList Headfold returned ~w heads in ~w ms~n",
[length(KLBySeg),
timer:now_diff(os:timestamp(), SW_SL0)/1000]),
true = length(KLBySeg) < KeyCount div 1000, % not too many false answers true = length(KLBySeg) < KeyCount div 1000, % not too many false answers
KLBySegRem = lists:subtract(KLBySeg, BKList), KLBySegRem = lists:subtract(KLBySeg, BKList),
true = length(KLBySeg) - length(KLBySegRem) == length(BKList), true = length(KLBySeg) - length(KLBySegRem) == length(BKList),
{async, HeadRFalsePositive} =
leveled_bookie:book_headfold(Bookie2,
?RIAK_TAG,
{HeadFoldFun, []},
true, false,
SegList ++ lists:seq(1, 256)),
% Make it a large seg list
SW_SL1 = os:timestamp(),
KLByXcessSeg = HeadRFalsePositive(),
io:format("SegList Headfold with xcess segments returned ~w heads in ~w ms~n",
[length(KLByXcessSeg),
timer:now_diff(os:timestamp(), SW_SL1)/1000]),
true = length(KLByXcessSeg) < KeyCount div 10, % Still not too many false answers
KLByXcessSegRem = lists:subtract(KLByXcessSeg, BKList),
true = length(KLByXcessSeg) - length(KLByXcessSegRem) == length(BKList),
ok = leveled_bookie:book_destroy(Bookie2). ok = leveled_bookie:book_destroy(Bookie2).