Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/bitcask.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ init_keydir(Dirname, WaitTime, ReadWriteModeP, KT) ->

case ScanResult of
{error, _} ->
ok = bitcask_nifs:keydir_release(KeyDir),
ScanResult;
_ ->
%% Now that we loaded all the data, mark the keydir as ready
Expand Down Expand Up @@ -3210,6 +3211,26 @@ update_tstamp_stats_test2() ->
bitcask_time:test__clear_fudge()
end.

scan_err_test_() ->
{setup,
fun() ->
meck:new(bitcask_fileops, [passthrough]),
ok
end,
fun(_) ->
meck:unload()
end,
[fun() ->
Dir = "/tmp/bc.scan.err",
meck:expect(bitcask_fileops, data_file_tstamps,
fun(_) -> {error, because} end),
?assertMatch({error, _}, bitcask:open(Dir)),
meck:unload(bitcask_fileops),
B = bitcask:open(Dir),
?assertMatch({true, B}, {is_reference(B), B}),
ok = bitcask:close(B)
end]}.

total_byte_stats_test_() ->
{timeout, 60, fun total_byte_stats_test2/0}.

Expand Down