diff options
author | Sverker Eriksson <[email protected]> | 2015-11-26 19:58:46 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-11-26 19:58:46 +0100 |
commit | cb971e3026082188be7f394ebf29603d5bd08118 (patch) | |
tree | c0e76c1da2192638d0940fd3139fbd0d5facb88c /erts/emulator/test | |
parent | 3ceb66666d35ccd6ff48fc018a3adc17706fd4cc (diff) | |
parent | 4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9 (diff) | |
download | otp-cb971e3026082188be7f394ebf29603d5bd08118.tar.gz otp-cb971e3026082188be7f394ebf29603d5bd08118.tar.bz2 otp-cb971e3026082188be7f394ebf29603d5bd08118.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/distribution_SUITE_data/run.erl | 47 |
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. |