aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/distribution_SUITE.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-03-21 10:53:37 +0100
committerLukas Larsson <[email protected]>2019-03-25 13:36:24 +0100
commit04ebb0fbb74ae9332c75041ddc302697ceb1a01e (patch)
tree3c2d17d031806bae45f0b890ccd0ebae58ee4f29 /erts/emulator/test/distribution_SUITE.erl
parent9915cfe184afa4fd3a361f65ec906a7bd164ead1 (diff)
downloadotp-04ebb0fbb74ae9332c75041ddc302697ceb1a01e.tar.gz
otp-04ebb0fbb74ae9332c75041ddc302697ceb1a01e.tar.bz2
otp-04ebb0fbb74ae9332c75041ddc302697ceb1a01e.zip
erts: Fix verify_nc in distribution suite
When the calling process is trapping exits a stray message will end up in the mailbox which is problematic. This change uses a monitor instead.
Diffstat (limited to 'erts/emulator/test/distribution_SUITE.erl')
-rw-r--r--erts/emulator/test/distribution_SUITE.erl19
1 files changed, 12 insertions, 7 deletions
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index 4f70b51aa0..516030ff82 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -2428,17 +2428,22 @@ stop_node(Node) ->
verify_nc(Node) ->
P = self(),
Ref = make_ref(),
- spawn(Node,
- fun() ->
- R = erts_test_utils:check_node_dist(fun(E) -> E end),
- P ! {Ref, R}
- end),
+ Pid = spawn(Node,
+ fun() ->
+ R = erts_test_utils:check_node_dist(fun(E) -> E end),
+ P ! {Ref, R}
+ end),
+ MonRef = monitor(process, Pid),
receive
{Ref, ok} ->
+ demonitor(MonRef,[flush]),
ok;
{Ref, Error} ->
- ct:log("~s",[Error]),
- ct:fail(failed_nc_refc_check)
+ ct:log("~p",[Error]),
+ ct:fail(failed_nc_refc_check);
+ {'DOWN', MonRef, _, _, _} = Down ->
+ ct:log("~p",[Down]),
+ ct:fail(crashed_nc_refc_check)
end.
freeze_node(Node, MS) ->