mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Added wait for ring to converge after bucket creation for both tests.
This commit is contained in:
parent
2cd4d748ae
commit
11ec2c3380
@ -9,6 +9,9 @@
|
||||
wait_until_nodes_ready/1,
|
||||
wait_until_no_pending_changes/1]).
|
||||
|
||||
%% export functions shared with other replication tests...
|
||||
-export([make_bucket/3]).
|
||||
|
||||
confirm() ->
|
||||
NumNodes = rt:config(num_nodes, 6),
|
||||
ClusterASize = rt:config(cluster_a_size, 3),
|
||||
@ -251,15 +254,17 @@ replication([AFirst|_] = ANodes, [BFirst|_] = BNodes, Connected) ->
|
||||
|
||||
lager:info("Nodes restarted"),
|
||||
|
||||
|
||||
case nodes_all_have_version(ANodes, "1.1.0") of
|
||||
true ->
|
||||
|
||||
make_bucket(LeaderA, NoRepl, [{repl, false}]),
|
||||
FollowsA = ANodes -- [LeaderA],
|
||||
make_bucket([LeaderA|FollowsA], NoRepl, [{repl, false}]),
|
||||
|
||||
case nodes_all_have_version(ANodes, "1.2.0") of
|
||||
true ->
|
||||
make_bucket(LeaderA, RealtimeOnly, [{repl, realtime}]),
|
||||
make_bucket(LeaderA, FullsyncOnly, [{repl, fullsync}]),
|
||||
make_bucket([LeaderA|FollowsA], RealtimeOnly, [{repl, realtime}]),
|
||||
make_bucket([LeaderA|FollowsA], FullsyncOnly, [{repl, fullsync}]),
|
||||
|
||||
%% disconnect the other cluster, so realtime doesn't happen
|
||||
lager:info("disconnect the 2 clusters"),
|
||||
@ -483,8 +488,9 @@ verify_site_ips(Leader, Site, Listeners) ->
|
||||
Listeners]),
|
||||
?assertEqual(ExpectedIPs, IPs).
|
||||
|
||||
make_bucket(Node, Name, Args) ->
|
||||
make_bucket([Node|_]=Nodes, Name, Args) ->
|
||||
Res = rpc:call(Node, riak_core_bucket, set_bucket, [Name, Args]),
|
||||
rt:wait_until_ring_converged(Nodes),
|
||||
?assertEqual(ok, Res).
|
||||
|
||||
start_and_wait_until_fullsync_complete(Node) ->
|
||||
|
@ -234,10 +234,11 @@ replication([AFirst|_] = ANodes, [BFirst|_] = BNodes, Connected) ->
|
||||
|
||||
lager:info("Nodes restarted"),
|
||||
|
||||
make_bucket(LeaderA, NoRepl, [{repl, false}]),
|
||||
FollowsA = ANodes -- [LeaderA],
|
||||
make_bucket([LeaderA|FollowsA], NoRepl, [{repl, false}]),
|
||||
|
||||
make_bucket(LeaderA, RealtimeOnly, [{repl, realtime}]),
|
||||
make_bucket(LeaderA, FullsyncOnly, [{repl, fullsync}]),
|
||||
make_bucket([LeaderA|FollowsA], RealtimeOnly, [{repl, realtime}]),
|
||||
make_bucket([LeaderA|FollowsA], FullsyncOnly, [{repl, fullsync}]),
|
||||
|
||||
%% disconnect the other cluster, so realtime doesn't happen
|
||||
lager:info("disconnect the 2 clusters"),
|
||||
@ -596,9 +597,8 @@ client_count(Node) ->
|
||||
Clients = rpc:call(Node, supervisor, which_children, [riak_repl_client_sup]),
|
||||
length(Clients).
|
||||
|
||||
make_bucket(Node, Name, Args) ->
|
||||
Res = rpc:call(Node, riak_core_bucket, set_bucket, [Name, Args]),
|
||||
?assertEqual(ok, Res).
|
||||
make_bucket(Nodes, Name, Args) ->
|
||||
replication:make_bucket(Nodes, Name, Args).
|
||||
|
||||
start_and_wait_until_fullsync_complete(Node) ->
|
||||
Status0 = rpc:call(Node, riak_repl_console, status, [quiet]),
|
||||
|
Loading…
Reference in New Issue
Block a user