aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/distribution_SUITE.erl29
-rw-r--r--erts/emulator/test/dump_SUITE.erl33
-rw-r--r--erts/emulator/test/multi_load_SUITE.erl10
3 files changed, 53 insertions, 19 deletions
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index 7885d35d9d..9dcdd60060 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -1400,6 +1400,10 @@ get_conflicting_unicode_atoms(CIX, N) ->
%% The message_latency_large tests that small distribution messages are
%% not blocked by other large distribution messages. Basically it tests
%% that fragmentation of distribution messages works.
+%%
+%% Because of large problems to get reliable values from these testcases
+%% they no longer fail when the latency is incorrect. However, they are
+%% kept as they continue to find bugs in the distribution implementation.
message_latency_large_message(Config) when is_list(Config) ->
measure_latency_large_message(?FUNCTION_NAME, fun(Dropper, Payload) -> Dropper ! Payload end).
@@ -1484,7 +1488,11 @@ measure_latency_large_message(Nodename, DataFun) ->
case {lists:max(Times), lists:min(Times)} of
{Max, Min} when Max * 0.25 > Min, BuildType =:= opt ->
- ct:fail({incorrect_latency, IndexTimes});
+ %% We only issue a comment for this failure as the
+ %% testcases proved very difficult to run successfully
+ %% on many platforms.
+ ct:comment({incorrect_latency, IndexTimes}),
+ ok;
_ ->
ok
end.
@@ -1503,10 +1511,7 @@ measure_latency(DataFun, Dropper, Echo, Payload) ->
end
end) || _ <- lists:seq(1,2)],
- [receive
- {monitor, _Sender, busy_dist_port, _Info} ->
- ok
- end || _ <- lists:seq(1,10)],
+ wait_for_busy_dist(2 * 60 * 1000, 10),
{TS, Times} =
timer:tc(fun() ->
@@ -1530,6 +1535,18 @@ measure_latency(DataFun, Dropper, Echo, Payload) ->
end || {Sender, Ref} <- Senders],
TS.
+wait_for_busy_dist(_Tmo, 0) ->
+ ok;
+wait_for_busy_dist(Tmo, N) ->
+ T0 = erlang:monotonic_time(millisecond),
+ receive
+ {monitor, _Sender, busy_dist_port, _Info} ->
+ wait_for_busy_dist(Tmo - (erlang:monotonic_time(millisecond) - T0), N - 1)
+ after Tmo ->
+ ct:log("Timed out waiting for busy_dist, ~p left",[N]),
+ timeout
+ end.
+
flush() ->
receive
_ ->
@@ -2600,7 +2617,7 @@ verify_nc(Node) ->
demonitor(MonRef,[flush]),
ok;
{Ref, Error} ->
- ct:log("~p",[Error]),
+ ct:log("~s",[Error]),
ct:fail(failed_nc_refc_check);
{'DOWN', MonRef, _, _, _} = Down ->
ct:log("~p",[Down]),
diff --git a/erts/emulator/test/dump_SUITE.erl b/erts/emulator/test/dump_SUITE.erl
index 9f8ac42fa9..b7da69e556 100644
--- a/erts/emulator/test/dump_SUITE.erl
+++ b/erts/emulator/test/dump_SUITE.erl
@@ -140,13 +140,13 @@ free_dump(Config) when is_list(Config) ->
{ok, NodeA} = start_node(Config),
{ok, NodeB} = start_node(Config),
-
Self = self(),
PidA = spawn_link(
NodeA,
fun() ->
Self ! ready,
+ Reason = lists:duplicate(1000000,100),
receive
ok ->
spawn(fun() ->
@@ -154,24 +154,29 @@ free_dump(Config) when is_list(Config) ->
timer:sleep(5),
receive
M ->
- io:format("~p",[M]),
- erlang:halt("dump")
- end
+ io:format("~p",[M])
+%% We may want to add this timeout here in-case no busy condition is triggered
+%% after 60 * 1000 ->
+%% io:format("Timeout")
+ end,
+ erlang:halt("dump")
end),
- exit(lists:duplicate(1000000,100))
+ exit(Reason)
end
end),
- spawn_link(NodeB,
- fun() ->
- [erlang:monitor(process, PidA) || _ <- lists:seq(1,10000)],
- Self ! done,
- receive _ -> ok end
- end),
+ PidB = 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])]),
+ %% Make the node busy towards NodeB for 10 seconds.
+ BusyPid = rpc:call(NodeA, distribution_SUITE, make_busy, [NodeB,10000]),
+ ct:pal("~p",[BusyPid]),
receive ready -> unlink(PidA), PidA ! ok end,
@@ -185,6 +190,10 @@ free_dump(Config) when is_list(Config) ->
file:delete(Dump),
+ unlink(PidB),
+
+ rpc:call(NodeB, erlang, halt, [0]),
+
ok.
diff --git a/erts/emulator/test/multi_load_SUITE.erl b/erts/emulator/test/multi_load_SUITE.erl
index edf3205812..c79e2b6dcd 100644
--- a/erts/emulator/test/multi_load_SUITE.erl
+++ b/erts/emulator/test/multi_load_SUITE.erl
@@ -30,7 +30,15 @@ all() ->
[many,on_load,errors].
many(_Config) ->
- Ms = make_modules(100, fun many_module/1),
+
+ N = case erlang:system_info(build_type) of
+ valgrind ->
+ 10;
+ _ ->
+ 100
+ end,
+
+ Ms = make_modules(N, fun many_module/1),
io:put_chars("Light load\n"
"=========="),