diff options
author | Lukas Larsson <lukas@erlang.org> | 2021-11-26 11:12:17 +0100 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2021-11-30 12:01:04 +0100 |
commit | 9a02967c07b7f0b9c727111f1e3575a8f36b4ef1 (patch) | |
tree | 4c7e211f9e3604bb2dd2232d0dc054538d886cb6 | |
parent | 3e2a5bb3b1ff4e0a19fae99434eaccdcadac622c (diff) | |
download | erlang-9a02967c07b7f0b9c727111f1e3575a8f36b4ef1.tar.gz |
erts: Unlink with nc checker to avoid noconnect signal
There was a race in the shutdown where the node would
exit before the normal exit signal was sent which would
case the testcase to fail with a noconnection exit signal.
-rw-r--r-- | erts/emulator/test/node_container_SUITE.erl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index 161968fe0d..3f781170a4 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -1037,21 +1037,23 @@ nc_refc_check(Node) when is_atom(Node) -> Ref = make_ref(), Self = self(), io:format("Starting reference count check of node ~w~n", [Node]), - spawn_link(Node, - fun () -> - erts_test_utils:check_node_dist( - fun (ErrMsg) -> - Self ! {Ref, ErrMsg, failed}, - exit(normal) - end), - Self ! {Ref, succeded} - end), + Pid = spawn_link( + Node, + fun () -> + erts_test_utils:check_node_dist( + fun (ErrMsg) -> + Self ! {Ref, ErrMsg, failed}, + exit(normal) + end), + Self ! {Ref, succeded} + end), receive {Ref, ErrorMsg, failed} -> io:format("~s~n", [ErrorMsg]), ct:fail(reference_count_check_failed); {Ref, succeded} -> io:format("Reference count check of node ~w succeded!~n", [Node]), + unlink(Pid), ok end. |