Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make tests work for otp20 #1315

Open
wants to merge 2 commits into
base: develop-3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion groups/kv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
loaded_upgrade
riak727
verify_riak_object_reformat
overload
overload_protection
riak_rex
verify_riak_stats
partition_repair
Expand Down
2 changes: 1 addition & 1 deletion groups/kv_all
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kv679_tombstone
kv679_tombstone2
kv679_uid
node_confirms_vs_pw
overload
overload_protection
partition_repair
pb_cipher_suites
pb_security
Expand Down
4 changes: 3 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{require_otp_vsn, "R16|17|18|19|20"}.
{minimum_otp_vsn, "20"}.
{cover_enabled, true}.
{edoc_opts, [{preprocess, true}]}.
%%{edoc_opts, [{doclet, edown_doclet}, {pretty_printer, erl_pp}]}.
Expand Down Expand Up @@ -26,6 +26,8 @@
{escript_incl_apps, [goldrush, lager, getopt, riakhttpc, riakc, ibrowse, mochiweb, kvc, kv_index_tictactree]}.
{escript_emu_args, "%%! -escript main riak_test_escript +K true +P 10000 -env ERL_MAX_PORTS 10000\n"}.

{extra_src_dirs, ["tests"]}.

{post_hooks, [{"(linux|darwin|solaris|freebsd|netbsd|openbsd)",
escriptize,
"cp \"$REBAR_BUILD_DIR/bin/riak_test\" ./riak_test"},
Expand Down
6 changes: 3 additions & 3 deletions tests/jmx_verify.erl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ test_supervision() ->
case net_adm:ping(Node) of
pang ->
lager:error("riak_jmx crash able to crash riak node"),
?assertEqual("riak_jmx crash able to crash riak node", true);
?assert(false, "riak_jmx crash able to crash riak node");
_ ->
yay
end,
Expand Down Expand Up @@ -186,7 +186,7 @@ test_application_stop() ->
case net_adm:ping(Node) of
pang ->
lager:error("riak_jmx stop takes down riak node"),
?assertEqual("riak_jmx stop takes down riak node", true);
?assert(false, "riak_jmx stop takes down riak node");
_ ->
yay
end,
Expand Down Expand Up @@ -225,4 +225,4 @@ jmx_dump(Cmd) ->
lager:info("Dumping JMX stats using command ~s", [Cmd]),
Output = string:strip(os:cmd(Cmd), both, $\n),
JSONOutput = mochijson2:decode(Output),
[ {Key, Value} || {struct, [{Key, Value}]} <- JSONOutput].
[ {Key, Value} || {struct, [{Key, Value}]} <- JSONOutput].
8 changes: 4 additions & 4 deletions tests/loaded_upgrade.erl
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ upgrade_recv_loop(EndTime) ->
_ ->
receive
{mapred, Node, bad_result} ->
?assertEqual(true, {mapred, Node, bad_result});
?assert(false, {mapred, Node, bad_result});
{kv, Node, not_equal} ->
?assertEqual(true, {kv, Node, bad_result});
?assert(false, {kv, Node, bad_result});
{kv, Node, {notfound, Key}} ->
?assertEqual(true, {kv, Node, {notfound, Key}});
?assert(false, {kv, Node, {notfound, Key}});
{listkeys, Node, not_equal} ->
?assertEqual(true, {listkeys, Node, not_equal});
?assert(false, {listkeys, Node, not_equal});
Msg ->
lager:debug("Received Mesg ~p", [Msg]),
upgrade_recv_loop(EndTime)
Expand Down
2 changes: 1 addition & 1 deletion tests/overload.erl → tests/overload_protection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%% under the License.
%%
%% -------------------------------------------------------------------
-module(overload).
-module(overload_protection).
-compile([export_all, nowarn_export_all]).
-include_lib("eunit/include/eunit.hrl").

Expand Down
2 changes: 1 addition & 1 deletion tests/pb_cipher_suites.erl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pb_connection_info(Port, Config) ->
{ok, PB} = riakc_pb_socket:start("127.0.0.1", Port, Config),
?assertEqual(pong, riakc_pb_socket:ping(PB)),

ConnInfo = ssl:connection_info(pb_get_socket(PB)),
ConnInfo = ssl:connection_information(pb_get_socket(PB)),

riakc_pb_socket:stop(PB),
ConnInfo.
Expand Down
16 changes: 8 additions & 8 deletions tests/replication2_pg.erl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ test_basic_pg(Mode, SSL) ->
rt:pbc_write(PidA, Bucket, KeyA, ValueA),
rt:pbc_write(PidA, Bucket, KeyB, ValueB),

_FirstA = hd(ANodes),
_ = hd(ANodes),
FirstB = hd(BNodes),
FirstC = hd(CNodes),
PidB = rt:pbc(FirstB),
Expand Down Expand Up @@ -286,9 +286,9 @@ test_12_pg(Mode, SSL) ->
{Bucket, KeyB, ValueB} = make_test_object("b"),

rt:log_to_nodes(AllNodes, "Test 1.2 proxy_get"),
_FirstA = hd(ANodes),
_ = hd(ANodes),
FirstB = hd(BNodes),
_FirstC = hd(CNodes),
_ = hd(CNodes),
case Mode of
mode_repl12 ->
ModeRes = rpc:call(FirstB, riak_repl_console, modes, [["mode_repl12"]]),
Expand Down Expand Up @@ -406,7 +406,7 @@ test_pg_proxy(SSL) ->
%% before it actually does any work.
FirstA = hd(ANodes),
FirstB = hd(BNodes),
_FirstC = hd(CNodes),
_ = hd(CNodes),
PidB = rt:pbc(FirstB),
lager:info("Connected to cluster B"),
{ok, PGResult} = riak_repl_pb_api:get(PidB,Bucket,KeyA,CidA),
Expand Down Expand Up @@ -453,7 +453,7 @@ test_cluster_mapping(SSL) ->
{LeaderA, ANodes, BNodes, CNodes, _AllNodes} =
setup_repl_clusters(Conf, SSL),

_FirstA = hd(ANodes),
_ = hd(ANodes),
FirstB = hd(BNodes),
FirstC = hd(CNodes),
LeaderB = rpc:call(FirstB, riak_core_cluster_mgr, get_leader, []),
Expand Down Expand Up @@ -576,7 +576,7 @@ test_bidirectional_pg(SSL) ->

FirstA = hd(ANodes),
FirstB = hd(BNodes),
_FirstC = hd(CNodes),
_ = hd(CNodes),

LeaderB = rpc:call(FirstB, riak_repl2_leader, leader_node, []),

Expand Down Expand Up @@ -677,7 +677,7 @@ test_multiple_sink_pg(SSL) ->
rt:pbc_write(PidA, Bucket, KeyA, ValueA),
rt:pbc_write(PidA, Bucket, KeyB, ValueB),

_FirstA = hd(ANodes),
_ = hd(ANodes),
FirstB = hd(BNodes),
FirstC = hd(CNodes),

Expand Down Expand Up @@ -730,7 +730,7 @@ test_mixed_pg(SSL) ->
rt:pbc_write(PidA, Bucket, KeyB, ValueB),
rt:pbc_write(PidA, Bucket, KeyC, ValueC),

_FirstA = hd(ANodes),
_ = hd(ANodes),
FirstB = hd(BNodes),
FirstC = hd(CNodes),
rt:wait_until_ring_converged(ANodes),
Expand Down
2 changes: 1 addition & 1 deletion tests/verify_2i_aae.erl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ run_2i_repair(Node1) ->
after
MaxWaitTime ->
lager:error("Timed out (~pms) waiting for 2i AAE repair process", [MaxWaitTime]),
?assertEqual(aae_2i_repair_complete, aae_2i_repair_timeout)
?assert(false, {aae_2i_repair_complete,aae_2i_repair_timeout})
end.

set_skip_index_specs(Node, Val) ->
Expand Down
2 changes: 1 addition & 1 deletion tests/verify_aae.erl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ verify_data(Node, KeyValues) ->
lager:info("Data is now correct. Yay!");
fail ->
lager:error("AAE failed to fix data"),
?assertEqual(aae_fixed_data, aae_failed_to_fix_data)
?assert(false, aae_failed_to_fix_data)
end,
riakc_pb_socket:stop(PB),
ok.
Expand Down
2 changes: 1 addition & 1 deletion tests/verify_counter_repl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ verify_counter(ExpectedValue, Node) ->
ExpectedValue == get_counter(Node).

rand_amt() ->
crypto:rand_uniform(-100, 100).
-100 + rand:uniform(100*2).

%% Set up bi-directional full sync replication.
repl_power_activate(ClusterA, ClusterB) ->
Expand Down
2 changes: 1 addition & 1 deletion tests/verify_put_opt_node_confirms.erl
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,4 @@ new_bucket(Bucket) when is_binary(Bucket) ->

%% string like random bytes
random_char() ->
<<(crypto:rand_uniform(65, 90))>>.
<<(rand:uniform(65, 90))>>.
2 changes: 1 addition & 1 deletion tests/verify_tictac_aae.erl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ verify_data(Node, KeyValues) ->
lager:info("Data is now correct. Yay!");
fail ->
lager:error("AAE failed to fix data"),
?assertEqual(aae_fixed_data, aae_failed_to_fix_data)
?assert(false, aae_failed_to_fix_data)
end,
riakc_pb_socket:stop(PB),
ok.
Expand Down