aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-06-03 14:29:17 +0200
committerLukas Larsson <[email protected]>2019-06-27 16:27:19 +0200
commita4752223c850305a2870a82eeb043391c372eec9 (patch)
tree5641af67241cfc8e7ab59e023c4410e38cd32ee0 /erts
parente10f627086df0998eaf6b2f538184846b6ed213f (diff)
downloadotp-a4752223c850305a2870a82eeb043391c372eec9.tar.gz
otp-a4752223c850305a2870a82eeb043391c372eec9.tar.bz2
otp-a4752223c850305a2870a82eeb043391c372eec9.zip
erts: Make dump_SUITE:free_dump tc more robust to different systems
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/test/dump_SUITE.erl33
1 files changed, 21 insertions, 12 deletions
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.