fix new config problems, tests all pass again
The tests pass but there's still a "NIF upgrade" error reported at the end of each test run. Will fix later.
This commit is contained in:
parent
83dfc9e396
commit
e6dc7a5936
5 changed files with 17 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,4 +5,5 @@ priv/*.so
|
|||
c_src/system
|
||||
c_src/wiredtiger-*/
|
||||
c_src/*.o
|
||||
deps
|
||||
*~
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%%
|
||||
%% riak_kv_wiredtiger_backend: Use WiredTiger for Riak/KV storage
|
||||
%%
|
||||
%% Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved.
|
||||
%% Copyright (c) 2012-2013 Basho Technologies, Inc. All Rights Reserved.
|
||||
%%
|
||||
%% This file is provided to you under the Apache License,
|
||||
%% Version 2.0 (the "License"); you may not use this file
|
||||
|
@ -80,9 +80,9 @@ capabilities(_, _) ->
|
|||
|
||||
%% @doc Start the WiredTiger backend
|
||||
-spec start(integer(), config()) -> {ok, state()} | {error, term()}.
|
||||
start(Partition, Config) ->
|
||||
start(Partition, Config0) ->
|
||||
%% Get the data root directory
|
||||
case app_helper:get_prop_or_env(data_root, Config, wt) of
|
||||
case app_helper:get_prop_or_env(data_root, Config0, wt) of
|
||||
<<"">> ->
|
||||
lager:error("Failed to startup WiredTiger: data_root is not valid"),
|
||||
{error, data_root_unset};
|
||||
|
@ -93,6 +93,7 @@ start(Partition, Config) ->
|
|||
lager:error("Failed to startup WiredTiger: data_root is not set"),
|
||||
{error, data_root_unset};
|
||||
DataRoot ->
|
||||
Config = lists:keydelete(data_root, 1, Config0),
|
||||
CacheSize =
|
||||
case proplists:get_value(cache_size, Config) of
|
||||
undefined ->
|
||||
|
@ -508,13 +509,13 @@ best_guess_at_a_reasonable_cache_size(ChunkSizeInMB) ->
|
|||
-ifdef(TEST).
|
||||
|
||||
simple_test_() ->
|
||||
?assertCmd("rm -rf test/wiredtiger-backend"),
|
||||
application:set_env(wt, data_root, "test/wiredtiger-backend"),
|
||||
?assertCmd("rm -rf test/wt-backend"),
|
||||
application:set_env(wt, data_root, "test/wt-backend"),
|
||||
temp_riak_kv_backend:standard_test(?MODULE, []).
|
||||
|
||||
custom_config_test_() ->
|
||||
?assertCmd("rm -rf test/wiredtiger-backend"),
|
||||
?assertCmd("rm -rf test/wt-backend"),
|
||||
application:set_env(wt, data_root, ""),
|
||||
temp_riak_kv_backend:standard_test(?MODULE, [{data_root, "test/wiredtiger-backend"}]).
|
||||
temp_riak_kv_backend:standard_test(?MODULE, [{data_root, "test/wt-backend"}]).
|
||||
|
||||
-endif.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%%
|
||||
%% riak_kv_backend: Riak backend behaviour
|
||||
%%
|
||||
%% Copyright (c) 2007-2010 Basho Technologies, Inc. All Rights Reserved.
|
||||
%% Copyright (c) 2007-2013 Basho Technologies, Inc. All Rights Reserved.
|
||||
%%
|
||||
%% This file is provided to you under the Apache License,
|
||||
%% Version 2.0 (the "License"); you may not use this file
|
||||
|
@ -36,6 +36,7 @@
|
|||
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-compile(export_all).
|
||||
-export([standard_test/2]).
|
||||
-endif.
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%%
|
||||
%% wt: Erlang Wrapper for WiredTiger
|
||||
%%
|
||||
%% Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved.
|
||||
%% Copyright (c) 2012-2013 Basho Technologies, Inc. All Rights Reserved.
|
||||
%%
|
||||
%% This file is provided to you under the Apache License,
|
||||
%% Version 2.0 (the "License"); you may not use this file
|
||||
|
@ -64,7 +64,6 @@
|
|||
fold/3]).
|
||||
|
||||
-ifdef(TEST).
|
||||
-export([config_to_bin/1]).
|
||||
-ifdef(EQC).
|
||||
-include_lib("eqc/include/eqc.hrl").
|
||||
-define(QC_OUT(P),
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%%
|
||||
%% wt_conn: manage a connection to WiredTiger
|
||||
%%
|
||||
%% Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved.
|
||||
%% Copyright (c) 2012-2013 Basho Technologies, Inc. All Rights Reserved.
|
||||
%%
|
||||
%% This file is provided to you under the Apache License,
|
||||
%% Version 2.0 (the "License"); you may not use this file
|
||||
|
@ -93,14 +93,14 @@ handle_call({open, Dir, Config, Caller}, _From, #state{conn=undefined}=State) ->
|
|||
true ->
|
||||
[];
|
||||
false ->
|
||||
[{cache_size, config_value(cache_size, Config, "512MB")}]
|
||||
[config_value(cache_size, Config, "512MB")]
|
||||
end,
|
||||
OptsC =
|
||||
case proplists:is_defined(session_max, Config) of
|
||||
true ->
|
||||
[];
|
||||
false ->
|
||||
[{session_max, config_value(session_max, Config, 100)}]
|
||||
[config_value(session_max, Config, 100)]
|
||||
end,
|
||||
Opts = lists:merge([OptsA, OptsB, OptsC, Config]),
|
||||
{Reply, NState} =
|
||||
|
@ -233,14 +233,14 @@ simple_test_() ->
|
|||
end}]}.
|
||||
|
||||
open_one() ->
|
||||
{ok, Ref} = open("test/wt-backend", [{session_max, 20}]),
|
||||
{ok, Ref} = open("test/wt-backend", [{create,true},{session_max, 20}]),
|
||||
true = is_open(),
|
||||
close(Ref),
|
||||
false = is_open(),
|
||||
ok.
|
||||
|
||||
open_and_wait(Pid) ->
|
||||
{ok, Ref} = open("test/wt-backend"),
|
||||
{ok, Ref} = open("test/wt-backend", [{create,true}]),
|
||||
Pid ! open,
|
||||
receive
|
||||
close ->
|
||||
|
|
Loading…
Reference in a new issue