From 3e9c74400d20d95e9bbc378478dc00cbafba6b47 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 12 Apr 2019 10:42:39 +0200 Subject: erts: Run smaller dist frag test to 32 bit machines Because of fragmentation of memory it is not always possible to allocate enough 320 MB segments on 32-bit so we only sent smaller packets there. --- erts/emulator/test/distribution_SUITE.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index 58194cf167..c8f190d29d 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -1480,11 +1480,14 @@ measure_latency_large_message(Nodename, DataFun) -> Echo = spawn(N, fun F() -> receive {From, Msg} -> From ! Msg, F() end end), - case erlang:system_info(build_type) of - debug -> + BuildType = erlang:system_info(build_type), + WordSize = erlang:system_info(wordsize), + + if + BuildType =/= opt; WordSize =:= 4 -> %% Test 3.2 MB and 32 MB and test the latency difference of sent messages Payloads = [{I, <<0:(I * 32 * 1024 * 8)>>} || I <- [1,10]]; - _ -> + true -> %% Test 32 MB and 320 MB and test the latency difference of sent messages Payloads = [{I, <<0:(I * 32 * 1024 * 1024 * 8)>>} || I <- [1,10]] end, @@ -1499,7 +1502,7 @@ measure_latency_large_message(Nodename, DataFun) -> stop_node(N), case {lists:max(Times), lists:min(Times)} of - {Max, Min} when Max * 0.25 > Min -> + {Max, Min} when Max * 0.25 > Min, BuildType =:= opt -> ct:fail({incorrect_latency, IndexTimes}); _ -> ok -- cgit v1.2.3 From 8cba01c623eeb962298750d60bf22f6d6f5538dc Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 12 Apr 2019 11:21:49 +0200 Subject: erts: Add extra debugging to dist frag testcases --- erts/emulator/test/distribution_SUITE.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index c8f190d29d..d1d1e3840e 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -1527,13 +1527,19 @@ measure_latency(DataFun, Dropper, Echo, Payload) -> ok end || _ <- lists:seq(1,10)], - {TS, _} = + {TS, Times} = timer:tc(fun() -> [begin + T0 = erlang:monotonic_time(), Echo ! {self(), hello}, - receive hello -> ok end + receive hello -> ok end, + (erlang:monotonic_time() - T0) / 1000000 end || _ <- lists:seq(1,100)] end), + Avg = lists:sum(Times) / length(Times), + StdDev = math:sqrt(lists:sum([math:pow(V - Avg,2) || V <- Times]) / length(Times)), + ct:pal("Times: Avg: ~p Max: ~p Min: ~p Var: ~p", + [Avg, lists:max(Times), lists:min(Times), StdDev]), [begin Sender ! die, receive -- cgit v1.2.3 From 94f7912c4a12a2a1ab325f62daebfe1b31fe101f Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 12 Apr 2019 11:48:22 +0200 Subject: erts: Make dump_SUITE:free_dump not dump via rpc Doing the dump via rpc can introduce all kins of strange timing issiues. So instead we dump 5ms after the exit has been started. --- erts/emulator/test/dump_SUITE.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/dump_SUITE.erl b/erts/emulator/test/dump_SUITE.erl index 3b860ebdf6..2440833992 100644 --- a/erts/emulator/test/dump_SUITE.erl +++ b/erts/emulator/test/dump_SUITE.erl @@ -146,7 +146,7 @@ free_dump(Config) when is_list(Config) -> Self ! ready, receive ok -> - unlink(Self), + spawn(fun() -> timer:sleep(5), erlang:halt("dump") end), exit(lists:duplicate(1000,1000)) end end), @@ -156,8 +156,6 @@ free_dump(Config) when is_list(Config) -> [erlang:monitor(process, Pid) || _ <- lists:seq(1,10000)], receive ready -> unlink(Pid), Pid ! ok end, - rpc:call(Node, erlang, halt, ["dump"]), - {ok, Bin} = get_dump_when_done(Dump), {match, Matches} = re:run(Bin,"^State: Non Existing", [global, multiline]), -- cgit v1.2.3 From bc39fa234dd2d2834985dcdd37159cbc9e4d8a51 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 15 Apr 2019 17:02:32 +0200 Subject: erts: Yield correctly when iterating over distr exit messages Before this fix the process would continue to process more distributed down or exit messages until it ran out of reductions instead of being suspended immediately. --- erts/emulator/test/distribution_SUITE.erl | 2 +- erts/emulator/test/dump_SUITE.erl | 49 +++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 16 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl index d1d1e3840e..84e95e6d26 100644 --- a/erts/emulator/test/distribution_SUITE.erl +++ b/erts/emulator/test/distribution_SUITE.erl @@ -77,7 +77,7 @@ optimistic_dflags_echo/0, optimistic_dflags_sender/1, roundtrip/1, bounce/1, do_dist_auto_connect/1, inet_rpc_server/1, dist_parallel_sender/3, dist_parallel_receiver/0, - dist_evil_parallel_receiver/0]). + dist_evil_parallel_receiver/0, make_busy/2]). %% epmd_module exports -export([start_link/0, register_node/2, register_node/3, port_please/2, address_please/3]). diff --git a/erts/emulator/test/dump_SUITE.erl b/erts/emulator/test/dump_SUITE.erl index 2440833992..9f8ac42fa9 100644 --- a/erts/emulator/test/dump_SUITE.erl +++ b/erts/emulator/test/dump_SUITE.erl @@ -137,24 +137,43 @@ exiting_dump(Config) when is_list(Config) -> free_dump(Config) when is_list(Config) -> Dump = filename:join(proplists:get_value(priv_dir, Config),"signal_abort.dump"), - {ok, Node} = start_node(Config), - - Self = self(), + {ok, NodeA} = start_node(Config), + {ok, NodeB} = start_node(Config), - Pid = spawn_link(Node, - fun() -> - Self ! ready, - receive - ok -> - spawn(fun() -> timer:sleep(5), erlang:halt("dump") end), - exit(lists:duplicate(1000,1000)) - end - end), - true = rpc:call(Node, os, putenv, ["ERL_CRASH_DUMP",Dump]), + Self = self(), - [erlang:monitor(process, Pid) || _ <- lists:seq(1,10000)], - receive ready -> unlink(Pid), Pid ! ok end, + PidA = spawn_link( + NodeA, + fun() -> + Self ! ready, + receive + ok -> + spawn(fun() -> + erlang:system_monitor(self(), [busy_dist_port]), + timer:sleep(5), + receive + M -> + io:format("~p",[M]), + erlang:halt("dump") + end + end), + exit(lists:duplicate(1000000,100)) + end + end), + + spawn_link(NodeB, + fun() -> + [erlang:monitor(process, PidA) || _ <- lists:seq(1,10000)], + Self ! done, + receive _ -> ok end + end), + + receive done -> ok end, + true = rpc:call(NodeA, os, putenv, ["ERL_CRASH_DUMP",Dump]), + ct:pal("~p",[rpc:call(NodeA, distribution_SUITE, make_busy, [NodeB, 1000])]), + + receive ready -> unlink(PidA), PidA ! ok end, {ok, Bin} = get_dump_when_done(Dump), -- cgit v1.2.3