mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Merge pull request #847 from basho/bugfix/dr/http_bucket_types_should_wait_for_visibility
Added rt:create_activate_and_wait_for_bucket_type
This commit is contained in:
commit
adbaa99da8
@ -1802,6 +1802,10 @@ create_and_activate_bucket_type(Node, Type, Props) ->
|
||||
ok = rpc:call(Node, riak_core_bucket_type, activate, [Type]),
|
||||
wait_until_bucket_type_status(Type, active, Node).
|
||||
|
||||
create_activate_and_wait_for_bucket_type([Node|_Rest]=Cluster, Type, Props) ->
|
||||
create_and_activate_bucket_type(Node, Type, Props),
|
||||
wait_until_bucket_type_visible(Cluster, Type).
|
||||
|
||||
wait_until_bucket_type_status(Type, ExpectedStatus, Nodes) when is_list(Nodes) ->
|
||||
[wait_until_bucket_type_status(Type, ExpectedStatus, Node) || Node <- Nodes];
|
||||
wait_until_bucket_type_status(Type, ExpectedStatus, Node) ->
|
||||
|
@ -101,10 +101,7 @@ confirm() ->
|
||||
|
||||
lager:info("custom type get/put test"),
|
||||
%% create a new type
|
||||
ok = rt:create_and_activate_bucket_type(Node, <<"mytype">>, [{n_val,3}]),
|
||||
|
||||
%% allow cluster metadata some time to propogate
|
||||
timer:sleep(1000),
|
||||
ok = rt:create_activate_and_wait_for_bucket_type(Nodes, <<"mytype">>, [{n_val,3}]),
|
||||
|
||||
lager:info("doing put"),
|
||||
ok = rhc:put(RHC, riakc_obj:new({<<"mytype">>, <<"bucket">>},
|
||||
@ -136,7 +133,7 @@ confirm() ->
|
||||
|
||||
UCBBin = {UnicodeTypeBin, UnicodeBucketBin},
|
||||
|
||||
ok = rt:create_and_activate_bucket_type(Node, UnicodeTypeBin, [{n_val,3}]),
|
||||
ok = rt:create_activate_and_wait_for_bucket_type(Nodes, UnicodeTypeBin, [{n_val,3}]),
|
||||
|
||||
lager:info("doing put"),
|
||||
ok = rhc:put(RHC, riakc_obj:new(UCBBin,
|
||||
@ -225,9 +222,7 @@ confirm() ->
|
||||
|
||||
%% make sure a newly created type is not affected either
|
||||
%% create a new type
|
||||
ok = rt:create_and_activate_bucket_type(Node, <<"mynewtype">>, []),
|
||||
%% allow cluster metadata some time to propogate
|
||||
timer:sleep(1000),
|
||||
ok = rt:create_activate_and_wait_for_bucket_type(Nodes, <<"mynewtype">>, []),
|
||||
|
||||
{ok, BProps11} = rhc:get_bucket_type(RHC, <<"mynewtype">>),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user