From 6665465d6237c4f22bcacdf7f441f9e3531cc870 Mon Sep 17 00:00:00 2001 From: Doug Rohrer Date: Tue, 24 Nov 2015 13:38:25 -0500 Subject: [PATCH] Updated tests to explicitly set allow_mult and dvv_enabled, as overriding default_bucket_props in advanced_config without explicitly setting these returns different values with the fix for allow_mult turning to true with an app.config file present. Cherry-picked from 619b24e --- src/rt.erl | 8 +++++++- tests/bucket_types.erl | 6 +++++- tests/ensemble_byzantine.erl | 13 +++++++++---- tests/ensemble_ring_changes.erl | 7 ++++++- tests/ensemble_util.erl | 13 +++++++++---- tests/http_bucket_types.erl | 6 +++++- tests/http_security.erl | 2 +- tests/overload.erl | 7 ++++++- tests/pb_security.erl | 2 +- tests/repl_aae_fullsync.erl | 7 ++++++- tests/repl_aae_fullsync_custom_n.erl | 7 ++++++- tests/repl_cancel_fullsync.erl | 7 ++++++- tests/repl_location_failures.erl | 7 ++++++- tests/replication_object_reformat.erl | 7 ++++++- tests/verify_counter_repl.erl | 2 +- tests/yz_default_bucket_type_upgrade.erl | 7 ++++++- 16 files changed, 86 insertions(+), 22 deletions(-) diff --git a/src/rt.erl b/src/rt.erl index 8dfc385d..7a36baec 100644 --- a/src/rt.erl +++ b/src/rt.erl @@ -721,7 +721,13 @@ wait_until_no_pending_changes(Nodes) -> rpc:multicall(Nodes, riak_core_vnode_manager, force_handoffs, []), {Rings, BadNodes} = rpc:multicall(Nodes, riak_core_ring_manager, get_raw_ring, []), Changes = [ riak_core_ring:pending_changes(Ring) =:= [] || {ok, Ring} <- Rings ], - BadNodes =:= [] andalso length(Changes) =:= length(Nodes) andalso lists:all(fun(T) -> T end, Changes) + case BadNodes =:= [] andalso length(Changes) =:= length(Nodes) andalso lists:all(fun(T) -> T end, Changes) of + true -> true; + false -> + NodesWithChanges = [Node || {Node, false} <- lists:zip(Nodes -- BadNodes, Changes)], + lager:info("Changes not yet complete, or bad nodes. BadNodes=~p, Nodes with Pending Changes=~p~n", [BadNodes, NodesWithChanges]), + false + end end, ?assertEqual(ok, wait_until(F)), ok. diff --git a/tests/bucket_types.erl b/tests/bucket_types.erl index 1715cee8..7e426be5 100644 --- a/tests/bucket_types.erl +++ b/tests/bucket_types.erl @@ -10,7 +10,11 @@ confirm() -> lager:info("Deploy some nodes"), Nodes = rt:build_cluster(4, [], [ {riak_core, [{default_bucket_props, - [{n_val, 2}]}]}]), + [ + {n_val, 2}, + {allow_mult, true}, + {dvv_enabled, true} + ]}]}]), Node = hd(Nodes), RMD = riak_test_runner:metadata(), diff --git a/tests/ensemble_byzantine.erl b/tests/ensemble_byzantine.erl index 0449fc57..155f1d5b 100644 --- a/tests/ensemble_byzantine.erl +++ b/tests/ensemble_byzantine.erl @@ -56,7 +56,7 @@ confirm() -> test_lose_minority_synctrees(PBC, Bucket, Key, Val, PL), test_lose_majority_synctrees(PBC, Bucket, Key, Val, PL), test_lose_minority_synctrees_one_node_partitioned(PBC, Bucket, Key, Val, - PL, Nodes), + PL, Nodes), test_lose_all_data_and_trees_except_one_node(PBC, Bucket, Key, Val, PL), {ok, _NewVal} = test_backup_restore_data_not_trees(Bucket, Key, Val, PL), test_lose_all_data(PBC, Bucket, Key, PL), @@ -64,7 +64,12 @@ confirm() -> pass. config() -> - [{riak_core, [{default_bucket_props, [{n_val, 5}]}, + [{riak_core, [{default_bucket_props, + [ + {n_val, 5}, + {allow_mult, true}, + {dvv_enabled, true} + ]}, {vnode_management_timer, 1000}, {ring_creation_size, 16}, {enable_consensus, true}, @@ -79,7 +84,7 @@ test_lose_majority_synctrees(PBC, Bucket, Key, Val, PL) -> assert_lose_synctrees_and_recover(PBC, Bucket, Key, Val, PL, Majority). test_lose_minority_synctrees_one_node_partitioned(PBC, Bucket, Key, Val, PL, - Nodes) -> + Nodes) -> Minority = minority_vnodes(PL), {{Idx0, Node0}, primary} = hd(PL), Ensemble = {kv, Idx0, 5}, @@ -251,7 +256,7 @@ kill_peers(Ensemble, Nodes) -> Peers = [P || P={_Id, N} <- View, lists:member(N, Nodes)], lager:info("Killing Peers: ~p", [Peers]), Pids = [rpc:call(Node, riak_ensemble_manager, get_peer_pid, - [Ensemble, Peer]) || Peer <- Peers], + [Ensemble, Peer]) || Peer <- Peers], [exit(Pid, kill) || Pid <- Pids, Pid =/= undefined]. wipe_partitions(PL) -> diff --git a/tests/ensemble_ring_changes.erl b/tests/ensemble_ring_changes.erl index 6823d76e..59e9bc36 100644 --- a/tests/ensemble_ring_changes.erl +++ b/tests/ensemble_ring_changes.erl @@ -27,7 +27,12 @@ -define(RING_SIZE, 16). config() -> - [{riak_core, [{default_bucket_props, [{n_val, 5}]}, + [{riak_core, [{default_bucket_props, + [ + {n_val, 5}, + {allow_mult, true}, + {dvv_enabled, true} + ]}, {vnode_management_timer, 1000}, {ring_creation_size, ?RING_SIZE}, {enable_consensus, true}, diff --git a/tests/ensemble_util.erl b/tests/ensemble_util.erl index d6f79145..e4cbb9db 100644 --- a/tests/ensemble_util.erl +++ b/tests/ensemble_util.erl @@ -58,10 +58,15 @@ fast_config(Nval, EnableAAE) when is_boolean(EnableAAE) -> fast_config(NVal, RingSize, EnableAAE) -> [config_aae(EnableAAE), - {riak_core, [{default_bucket_props, [{n_val, NVal}]}, - {vnode_management_timer, 1000}, - {ring_creation_size, RingSize}, - {enable_consensus, true}]}]. + {riak_core, [{default_bucket_props, + [ + {n_val, NVal, + {allow_mult, true}, + {dvv_enabled, true}} + ]}, + {vnode_management_timer, 1000}, + {ring_creation_size, RingSize}, + {enable_consensus, true}]}]. config_aae(true) -> {riak_kv, [{anti_entropy_build_limit, {100, 1000}}, diff --git a/tests/http_bucket_types.erl b/tests/http_bucket_types.erl index d5994b15..2ffe118c 100644 --- a/tests/http_bucket_types.erl +++ b/tests/http_bucket_types.erl @@ -13,7 +13,11 @@ confirm() -> lager:info("Deploy some nodes"), Nodes = rt:build_cluster(4, [], [ {riak_core, [{default_bucket_props, - [{n_val, 2}]}]}]), + [ + {n_val, 2}, + {allow_mult, true}, + {dvv_enabled, true} + ]}]}]), Node = hd(Nodes), RMD = riak_test_runner:metadata(), diff --git a/tests/http_security.erl b/tests/http_security.erl index 8bf09ddb..fac70e32 100644 --- a/tests/http_security.erl +++ b/tests/http_security.erl @@ -30,7 +30,7 @@ confirm() -> PrivDir = rt:priv_dir(), Conf = [ {riak_core, [ - {default_bucket_props, [{allow_mult, true}]}, + {default_bucket_props, [{allow_mult, true}, {dvv_enabled, true}]}, {ssl, [ {certfile, filename:join([CertDir, "site3.basho.com/cert.pem"])}, diff --git a/tests/overload.erl b/tests/overload.erl index 12e34203..96ca0430 100644 --- a/tests/overload.erl +++ b/tests/overload.erl @@ -57,7 +57,12 @@ default_config(#config{ fsm_limit = FsmLimit }) -> [{riak_core, [{ring_creation_size, 8}, - {default_bucket_props, [{n_val, 5}]}, + {default_bucket_props, + [ + {n_val, 5}, + {allow_mult, true}, + {dvv_enabled, true} + ]}, {vnode_management_timer, 1000}, {enable_health_checks, false}, {enable_consensus, true}, diff --git a/tests/pb_security.erl b/tests/pb_security.erl index 3b06d1d7..00d1bac9 100644 --- a/tests/pb_security.erl +++ b/tests/pb_security.erl @@ -53,7 +53,7 @@ confirm() -> PrivDir = rt:priv_dir(), Conf = [ {riak_core, [ - {default_bucket_props, [{allow_mult, true}]}, + {default_bucket_props, [{allow_mult, true}, {dvv_enabled, true}]}, {ssl, [ {certfile, filename:join([CertDir,"site3.basho.com/cert.pem"])}, {keyfile, filename:join([CertDir, "site3.basho.com/key.pem"])}, diff --git a/tests/repl_aae_fullsync.erl b/tests/repl_aae_fullsync.erl index a04e8601..243be3f0 100644 --- a/tests/repl_aae_fullsync.erl +++ b/tests/repl_aae_fullsync.erl @@ -16,7 +16,12 @@ {riak_core, [ {ring_creation_size, 8}, - {default_bucket_props, [{n_val, 1}]} + {default_bucket_props, + [ + {n_val, 1}, + {allow_mult, true}, + {dvv_enabled, true} + ]} ] }, {riak_kv, diff --git a/tests/repl_aae_fullsync_custom_n.erl b/tests/repl_aae_fullsync_custom_n.erl index a8294bcd..715510b0 100644 --- a/tests/repl_aae_fullsync_custom_n.erl +++ b/tests/repl_aae_fullsync_custom_n.erl @@ -22,7 +22,12 @@ confirm() -> {riak_core, [ {ring_creation_size, 8}, - {default_bucket_props, [{n_val, 1}]} + {default_bucket_props, + [ + {n_val, 1}, + {allow_mult, true}, + {dvv_enabled, true} + ]} ] }, {riak_kv, diff --git a/tests/repl_cancel_fullsync.erl b/tests/repl_cancel_fullsync.erl index 03c69b9e..bcbea39e 100644 --- a/tests/repl_cancel_fullsync.erl +++ b/tests/repl_cancel_fullsync.erl @@ -11,7 +11,12 @@ {riak_core, [ {ring_creation_size, 8}, - {default_bucket_props, [{n_val, 1}]} + {default_bucket_props, + [ + {n_val, 1}, + {allow_mult, true}, + {dvv_enabled, true} + ]} ] }, {riak_kv, diff --git a/tests/repl_location_failures.erl b/tests/repl_location_failures.erl index cb74985f..6151a454 100644 --- a/tests/repl_location_failures.erl +++ b/tests/repl_location_failures.erl @@ -13,7 +13,12 @@ {riak_core, [ {ring_creation_size, 8}, - {default_bucket_props, [{n_val, 1}]} + {default_bucket_props, + [ + {n_val, 1}, + {allow_mult, true}, + {dvv_enabled, true} + ]} ] }, {riak_kv, diff --git a/tests/replication_object_reformat.erl b/tests/replication_object_reformat.erl index cb1cf685..4112d9a5 100644 --- a/tests/replication_object_reformat.erl +++ b/tests/replication_object_reformat.erl @@ -11,7 +11,12 @@ {riak_core, [ {ring_creation_size, 8}, - {default_bucket_props, [{n_val, ?N}]} + {default_bucket_props, + [ + {n_val, ?N}, + {allow_mult, true}, + {dvv_enabled, true} + ]} ] }, {riak_kv, diff --git a/tests/verify_counter_repl.erl b/tests/verify_counter_repl.erl index 79a107b3..7e1a282c 100644 --- a/tests/verify_counter_repl.erl +++ b/tests/verify_counter_repl.erl @@ -62,7 +62,7 @@ confirm() -> make_clusters() -> Conf = [{riak_repl, [{fullsync_on_connect, false}, {fullsync_interval, disabled}]}, - {riak_core, [{default_bucket_props, [{allow_mult, true}]}]}], + {riak_core, [{default_bucket_props, [{allow_mult, true}, {dvv_enabled, true}]}]}], Nodes = rt:deploy_nodes(6, Conf, [riak_kv, riak_repl]), {ClusterA, ClusterB} = lists:split(3, Nodes), A = make_cluster(ClusterA, "A"), diff --git a/tests/yz_default_bucket_type_upgrade.erl b/tests/yz_default_bucket_type_upgrade.erl index f3d94e84..b61b4353 100644 --- a/tests/yz_default_bucket_type_upgrade.erl +++ b/tests/yz_default_bucket_type_upgrade.erl @@ -38,7 +38,12 @@ [{riak_core, [ {ring_creation_size, 16}, - {default_bucket_props, [{n_val, ?N}]}, + {default_bucket_props, + [ + {n_val, ?N}, + {allow_mult, true}, + {dvv_enabled, true} + ]}, {anti_entropy_build_limit, {100, 1000}}, {anti_entropy_concurrency, 8} ]},