Skip to content
This repository
Browse code

Remove gossip tests

These tests were originally written against an older version of riak
core and I couldn't see how to modify them to work with the new code.
I figure it is better to remove this code so that the other tests can
be added and this year old PR can finally be merged.
  • Loading branch information...
commit c6a74d597a956e0ef5b724d36b838193132342b9 1 parent 926c5fa
Ryan Zezeski authored August 22, 2012

Showing 1 changed file with 0 additions and 32 deletions. Show diff stats Hide diff stats

  1. 32  src/riak_core_gossip.erl
32  src/riak_core_gossip.erl
@@ -44,10 +44,6 @@
44 44
 
45 45
 -include("riak_core_ring.hrl").
46 46
 
47  
--ifdef(TEST).
48  
--include_lib("eunit/include/eunit.hrl").
49  
--endif.
50  
-
51 47
 %% Default gossip rate: allow at most 45 gossip messages every 10 seconds
52 48
 -define(DEFAULT_LIMIT, {45, 10000}).
53 49
 
@@ -501,31 +497,3 @@ attempt_simple_transfer(Seed, Ring, [{_, N}|Rest], TargetN, Exit, Idx, Last) ->
501 497
                             lists:keyreplace(N, 1, Last, {N, Idx}));
502 498
 attempt_simple_transfer(_, Ring, [], _, _, _, _) ->
503 499
     {ok, Ring}.
504  
-
505  
--ifdef(TEST).
506  
--include_lib("eunit/include/eunit.hrl").
507  
-
508  
-owners(Ring) ->
509  
-    lists:usort([Owner || {_, Owner} <- riak_core_ring:all_owners(Ring)]).
510  
-    
511  
-removal_test() ->
512  
-    application:set_env(riak_core, target_n_val, 3),
513  
-
514  
-    Ring1 = riak_core_ring:fresh(64, n1),
515  
-    ?assertEqual([n1], owners(Ring1)),
516  
-
517  
-    {_, Indices} = lists:foldl(fun({Idx, _}, {true, L}) ->
518  
-                                       {false, [Idx|L]};
519  
-                                  ({_, _}, {false, L}) ->
520  
-                                       {true, L}
521  
-                               end, {true, []}, riak_core_ring:all_owners(Ring1)),
522  
-    Ring2 = lists:foldl(fun(Idx, Ring) ->
523  
-                                riak_core_ring:transfer_node(Idx, n2, Ring)
524  
-                        end, Ring1, Indices),
525  
-    ?assertEqual([n1, n2], owners(Ring2)),
526  
-
527  
-    Ring3 = reassign_indices(Ring2, n2),
528  
-    ?assertEqual([n1], owners(Ring3)),
529  
-    ok.
530  
-
531  
--endif.

0 notes on commit c6a74d5

Please sign in to comment.
Something went wrong with that request. Please try again.