Skip to content

Commit 061264c

Browse files
committed
upgrade deps and remove rand_compat
1 parent 1fc259d commit 061264c

8 files changed

+32
-36
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
language: erlang
22
otp_release:
3-
- 20.0
3+
- 22.0
4+
- 21.2.5
5+
- 20.3
46
- 19.3
57
install:
8+
- wget https://s3.amazonaws.com/rebar3/rebar3 && chmod u+x rebar3
69
- make
7-
- ./rebar3 update
810
script:
911
- make test
1012
- make xref

rebar.config

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{min_otp_version, "19.0"}.
22

3-
{deps, [{lasp_support, "~>0.0"},
4-
time_compat,
5-
rand_compat,
6-
{partisan, "~>2.1"},
3+
{deps, [{lasp_support, "~>0.1"},
4+
{partisan, "~>4.1"},
75
{lager, "~>3.5"}]}.
86

97
{dialyzer_base_plt_apps, [kernel, stdlib, erts, sasl, eunit, syntax_tools, compiler, crypto]}.

rebar.lock

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{"1.1.0",
2-
[{<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0-rc.0">>},1},
2+
[{<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},1},
33
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
4-
{<<"lager">>,{pkg,<<"lager">>,<<"3.5.2">>},0},
5-
{<<"lasp_support">>,{pkg,<<"lasp_support">>,<<"0.0.3">>},0},
6-
{<<"partisan">>,{pkg,<<"partisan">>,<<"2.1.0">>},0},
7-
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"1.7.3">>},2},
8-
{<<"rand_compat">>,{pkg,<<"rand_compat">>,<<"0.0.3">>},0},
9-
{<<"time_compat">>,{pkg,<<"time_compat">>,<<"0.0.1">>},0},
4+
{<<"lager">>,{pkg,<<"lager">>,<<"3.8.0">>},0},
5+
{<<"lasp_support">>,{pkg,<<"lasp_support">>,<<"0.1.0">>},0},
6+
{<<"partisan">>,{pkg,<<"partisan">>,<<"4.1.0">>},0},
7+
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"1.7.5">>},2},
108
{<<"types">>,{pkg,<<"types">>,<<"0.1.8">>},1},
11-
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"1.7.3">>},1}]}.
9+
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"1.7.5">>},1}]}.
1210
[
1311
{pkg_hash,[
14-
{<<"acceptor_pool">>, <<"679D741DF87FC13599B1AEF2DF8F78F1F880449A6BEFAB7C44FB6FAE0E92A2DE">>},
12+
{<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>},
1513
{<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>},
16-
{<<"lager">>, <<"614A8C8F67BF99B69EB264EA22121AD25511C055AAEC09B086773D5108C6767F">>},
17-
{<<"lasp_support">>, <<"C1B7E1A472037AE82C71D2D16A10B7D644A621B66AE5AFE834CECF170F2E9169">>},
18-
{<<"partisan">>, <<"4B193F0D7D46F65894AE3A32E0DF379F7A00B5E853A2EBCA6CF6F2F42943D1E0">>},
19-
{<<"quickrand">>, <<"0E4FB48FAC904FE0C6E21D7E8C31A288A0700E1E81A35B38B649FC119079755D">>},
20-
{<<"rand_compat">>, <<"011646BC1F0B0C432FE101B816F25B9BBB74A085713CEE1DAFD2D62E9415EAD3">>},
21-
{<<"time_compat">>, <<"23FE0AD1FDF3B5B88821B2D04B4B5E865BF587AE66056D671FE0F53514ED8139">>},
14+
{<<"lager">>, <<"3402B9A7E473680CA179FC2F1D827CAB88DD37DD1E6113090C6F45EF05228A1C">>},
15+
{<<"lasp_support">>, <<"A6D665138BD8C10555FE7A4A2A81A8A47079EAE5FFC368D411DE660EB7A66F04">>},
16+
{<<"partisan">>, <<"51D3C1D6487BBB8F94D4FD313D03D93F1C0426350A3ADF84CC3B3243B8EA204E">>},
17+
{<<"quickrand">>, <<"E3086A153EB13A057FC19192D05E2D4C6BB2BDBB55746A699BEAE9847AC17CA8">>},
2218
{<<"types">>, <<"5782B67231E8C174FE2835395E71E669FE0121076779D2A09F1C0D58EE0E2F13">>},
23-
{<<"uuid">>, <<"C5DF97D1A3D626235C2415E74053C47B2138BB863C5CD802AB5CAECB8ECC019F">>}]}
19+
{<<"uuid">>, <<"3862FF9A21C42566DFD0376B97512FA202922897129E09A05E2AFA0D9CAFD97A">>}]}
2420
].

rebar3

-763 KB
Binary file not shown.

src/plumtree.app.src

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{application,plumtree,
22
[{description,"Epidemic Broadcast Trees"},
3-
{vsn,"0.5.0"},
3+
{vsn,"0.6.0"},
44
{registered,[]},
5-
{applications,[kernel,stdlib,crypto,lager,rand_compat,partisan]},
5+
{applications,[kernel,stdlib,crypto,lager,partisan]},
66
{mod,{plumtree_app,[]}},
77
{modules,[]},
88
{env,[{plumtree_data_dir,"data"}]},

src/plumtree_broadcast.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ random_other_node(OrdSet) ->
566566
case Size of
567567
0 -> undefined;
568568
_ ->
569-
lists:nth(rand_compat:uniform(Size),
569+
lists:nth(rand:uniform(Size),
570570
ordsets:to_list(OrdSet))
571571
end.
572572

test/plumtree_SUITE.erl

+10-10
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ membership_high_client_test(Config) ->
127127
membership_test(Config) ->
128128
%% Use the default peer service manager.
129129
Manager = proplists:get_value(partisan_peer_service_manager,
130-
Config, partisan_default_peer_service_manager),
130+
Config, partisan_pluggable_peer_service_manager),
131131
NServers = proplists:get_value(n_servers, Config, 1),
132132
NClients = proplists:get_value(n_clients, Config, ?CLIENT_NUMBER),
133133
% Partition = proplists:get_value(partition, Config, false),
@@ -154,15 +154,15 @@ membership_test(Config) ->
154154
%% check membership after cluster
155155
check_membership(Nodes),
156156

157-
BroadcastRounds1 = rand_compat:uniform(100),
157+
BroadcastRounds1 = rand:uniform(100),
158158
ct:pal("now doing ~p rounds of broadcast",
159159
[BroadcastRounds1]),
160160
%% do several rounds of broadcast from random nodes, then wait a bit for propagation
161161
lists:foreach(fun(_) ->
162162
{_, Node} = plumtree_test_utils:select_random(Nodes),
163163
ok = rpc:call(Node,
164164
plumtree_broadcast, broadcast,
165-
[{k, rand_compat:uniform()}, plumtree_test_broadcast_handler])
165+
[{k, rand:uniform()}, plumtree_test_broadcast_handler])
166166
end, lists:seq(1, BroadcastRounds1)),
167167
%% allow 100ms per broadcast to settle
168168
timer:sleep(100 * BroadcastRounds1),
@@ -173,12 +173,12 @@ membership_test(Config) ->
173173
%% now inject partitions in the broadcast tree until the graph is no longer connected
174174

175175
%% do some rounds of broadcast in order to repair the tree
176-
BroadcastRounds2 = rand_compat:uniform(100),
176+
BroadcastRounds2 = rand:uniform(100),
177177
lists:foreach(fun(_) ->
178178
{_, Node} = plumtree_test_utils:select_random(Nodes),
179179
ok = rpc:call(Node,
180180
plumtree_broadcast, broadcast,
181-
[{k, rand_compat:uniform()}, plumtree_test_broadcast_handler])
181+
[{k, rand:uniform()}, plumtree_test_broadcast_handler])
182182
end, lists:seq(1, BroadcastRounds2)),
183183
%% allow 100ms per broadcast to settle
184184
timer:sleep(100 * BroadcastRounds1),
@@ -190,7 +190,7 @@ membership_test(Config) ->
190190
broadcast_test(Config) ->
191191
%% Use the default peer service manager.
192192
Manager = proplists:get_value(partisan_peer_service_manager,
193-
Config, partisan_default_peer_service_manager),
193+
Config, partisan_pluggable_peer_service_manager),
194194
NServers = proplists:get_value(n_servers, Config, 1),
195195
NClients = proplists:get_value(n_clients, Config, ?CLIENT_NUMBER),
196196
Partition = proplists:get_value(partition, Config, false),
@@ -221,12 +221,12 @@ broadcast_test(Config) ->
221221
maybe_resolve_partition(Partition, Reference, Manager, Nodes),
222222

223223
%% do several rounds of broadcast from random nodes, then wait a bit for propagation
224-
BroadcastRounds1 = rand_compat:uniform(100),
224+
BroadcastRounds1 = rand:uniform(100),
225225
lists:foreach(fun(_) ->
226226
{_, Node} = plumtree_test_utils:select_random(Nodes),
227227
ok = rpc:call(Node,
228228
plumtree_broadcast, broadcast,
229-
[{k, rand_compat:uniform()}, plumtree_test_broadcast_handler])
229+
[{k, rand:uniform()}, plumtree_test_broadcast_handler])
230230
end, lists:seq(1, BroadcastRounds1)),
231231
%% allow 500ms per broadcast to settle
232232
timer:sleep(200 * BroadcastRounds1),
@@ -235,7 +235,7 @@ broadcast_test(Config) ->
235235
check_membership(Nodes),
236236

237237
%% do a final round of broadcast, also from a random node, which is the one we'll be checking
238-
Rand = rand_compat:uniform(),
238+
Rand = rand:uniform(),
239239
{_, RandomNode} = plumtree_test_utils:select_random(Nodes),
240240
ok = rpc:call(RandomNode,
241241
plumtree_broadcast, broadcast,
@@ -434,7 +434,7 @@ cluster({Name, _Node} = Myself, Nodes, Options) when is_list(Nodes) ->
434434
AmIClient = lists:member(Name, Clients),
435435

436436
OtherNodes = case Manager of
437-
partisan_default_peer_service_manager ->
437+
partisan_pluggable_peer_service_manager ->
438438
%% Omit just ourselves.
439439
omit([Name], Nodes);
440440
partisan_client_server_peer_service_manager ->

test/plumtree_test_utils.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ select_random(List0, Omit) ->
159159
List = List0 -- lists:flatten([Omit]),
160160
%% Catch exceptions where there may not be enough members.
161161
try
162-
Index = rand_compat:uniform(length(List)),
162+
Index = rand:uniform(length(List)),
163163
lists:nth(Index, List)
164164
catch
165165
_:_ ->

0 commit comments

Comments
 (0)