Skip to content

Commit 70405cd

Browse files
committed
Fix test
1 parent 7409307 commit 70405cd

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

test/osiris_log_SUITE.erl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -480,25 +480,25 @@ iterator_read_chunk_with_read_ahead(Config) ->
480480
W1;
481481
(read, #{r := R0, tracer := T}) ->
482482
%% first chunk, there won't be any data size hints in the reader
483-
{ok, H, I0, R1} = osiris_log:chunk_iterator(R0),
483+
{ok, _, I0, R1} = osiris_log:chunk_iterator(R0),
484484
{{_, <<"ho">>}, I1} = osiris_log:iterator_next(I0),
485485
{{_, <<"hi">>}, I2} = osiris_log:iterator_next(I1),
486486
?assertMatch(end_of_chunk, osiris_log:iterator_next(I2)),
487487
?assertEqual(2, length(osiris_tracer:calls(T))),
488-
{H, R1}
488+
R1
489489
end,
490490
fun(write, #{w := W0}) ->
491491
%% this one will be read ahead
492492
EntriesRev = [<<"foo">>, <<"bar">>],
493493
{_, W1} = write_committed(EntriesRev, W0),
494494
W1;
495495
(read, #{r := R0, tracer := T}) ->
496-
{ok, H, I0, R1} = osiris_log:chunk_iterator(R0),
496+
{ok, _, I0, R1} = osiris_log:chunk_iterator(R0),
497497
{{_, <<"bar">>}, I1} = osiris_log:iterator_next(I0),
498498
{{_, <<"foo">>}, I2} = osiris_log:iterator_next(I1),
499499
?assertMatch(end_of_chunk, osiris_log:iterator_next(I2)),
500500
?assertEqual(0, length(osiris_tracer:calls(T))),
501-
{H, R1}
501+
R1
502502
end,
503503
fun(write, #{w := W0}) ->
504504
%% this one will be read ahead
@@ -508,12 +508,12 @@ iterator_read_chunk_with_read_ahead(Config) ->
508508
W1;
509509
(read, #{r := R0, tracer := T}) ->
510510
E1 = binary:copy(<<"b">>, RAL - 200),
511-
{ok, H, I0, R1} = osiris_log:chunk_iterator(R0),
511+
{ok, _, I0, R1} = osiris_log:chunk_iterator(R0),
512512
{{_, <<"aaa">>}, I1} = osiris_log:iterator_next(I0),
513513
{{_, E1}, I2} = osiris_log:iterator_next(I1),
514514
?assertMatch(end_of_chunk, osiris_log:iterator_next(I2)),
515515
?assertEqual(0, length(osiris_tracer:calls(T))),
516-
{H, R1}
516+
R1
517517
end,
518518
fun(write, #{w := W0}) ->
519519
%% this one is too big to be read ahead
@@ -523,12 +523,12 @@ iterator_read_chunk_with_read_ahead(Config) ->
523523
W1;
524524
(read, #{r := R0, tracer := T}) ->
525525
E1 = binary:copy(<<"b">>, RAL * 2),
526-
{ok, H, I0, R1} = osiris_log:chunk_iterator(R0),
526+
{ok, _, I0, R1} = osiris_log:chunk_iterator(R0),
527527
{{_, <<"aaa">>}, I1} = osiris_log:iterator_next(I0),
528528
{{_, E1}, I2} = osiris_log:iterator_next(I1),
529529
?assertMatch(end_of_chunk, osiris_log:iterator_next(I2)),
530530
?assertEqual(2, length(osiris_tracer:calls(T))),
531-
{H, R1}
531+
R1
532532
end
533533
],
534534

test/osiris_tracer.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ calls(P) ->
4141

4242
calls(P, M, F) ->
4343
Calls = calls(P),
44-
lists:filter(fun({M1, F1, _A}) -> M1 =:= M, F1 =:= F; (_) -> false end, Calls).
44+
lists:filter(fun({M1, F1, _A}) when M1 == M andalso F1 == F ->
45+
true;
46+
(_) -> false
47+
end, Calls).
4548

4649
stop(P) ->
4750
erlang:trace(self(), false, [call]),

0 commit comments

Comments
 (0)