aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-11-26 19:56:51 +0100
committerSverker Eriksson <[email protected]>2015-11-26 19:56:51 +0100
commit4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9 (patch)
tree5b151ec5340a85af698ae3bceb21a2a8ab390548 /erts/emulator/test
parenta89f1cd881396fc6445b7d790ee2f5b7ae5a6031 (diff)
parent949de78331b9c4ecb9c628bb651cecb113790e2e (diff)
downloadotp-4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9.tar.gz
otp-4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9.tar.bz2
otp-4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9.zip
Merge branch 'sverk/setnode-rename-bug/OTP-13076' into maint
* sverk/setnode-rename-bug/OTP-13076: erts: Fix bug in setnode/2 erts: Remove ERTS_PSD_DIST_ENTRY erts: Remove faulty ASSERT in erts_proc_*_refc
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/distribution_SUITE_data/run.erl47
1 files changed, 38 insertions, 9 deletions
diff --git a/erts/emulator/test/distribution_SUITE_data/run.erl b/erts/emulator/test/distribution_SUITE_data/run.erl
index f5169e160c..d5ed139369 100644
--- a/erts/emulator/test/distribution_SUITE_data/run.erl
+++ b/erts/emulator/test/distribution_SUITE_data/run.erl
@@ -30,16 +30,19 @@ from(H, [_ | T]) -> from(H, T);
from(H, []) -> [].
start() ->
- net_kernel:start([fideridum,shortnames]),
- {ok, Node} = slave:start(host(), heppel),
- P = spawn(Node, a, b, []),
- B1 = term_to_binary(P),
- N1 = node(P),
- ok = net_kernel:stop(),
- N2 = node(P),
- io:format("~w~n", [N1 == N2]),
+ Result = do_it(),
+
+ %% Do GCs and node_and_dist_references
+ %% in an attempt to crash the VM (without OTP-13076 fix)
+ lists:foreach(fun(P) -> erlang:garbage_collect(P) end,
+ processes()),
+ erts_debug:set_internal_state(available_internal_state, true),
+ erts_debug:get_internal_state(node_and_dist_references),
+
+ io:format("~w~n", [Result]),
+
if
- N1 == N2 ->
+ Result ->
init:stop();
true ->
%% Make sure that the io:format/2 output is really written
@@ -47,3 +50,29 @@ start() ->
erlang:yield(),
init:stop()
end.
+
+
+do_it() ->
+ {ok, _} = net_kernel:start([fideridum,shortnames]),
+ {ok, Node} = slave:start(host(), heppel),
+ P = spawn(Node, net_kernel, stop, []),
+ B1 = term_to_binary(P),
+ N1 = node(P),
+ ok = net_kernel:stop(),
+ N2 = node(P),
+
+ %% OTP-13076
+ %% Restart distribution with same node name as previous remote node
+ %% Repeat to wrap around creation
+ Result = lists:foldl(fun(_, Acc) ->
+ timer:sleep(2), % give net_kernel:stop() time to take effect :-(
+ {ok, _} = net_kernel:start([heppel,shortnames]),
+ N3 = node(P),
+ ok = net_kernel:stop(),
+ N4 = node(P),
+ Acc and (N3 =:= N1) and (N4 =:= N1)
+ end,
+ (N2 =:= N1),
+ lists:seq(1,3)),
+
+ Result.