aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/loose_node.erl
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2016-06-10 14:58:24 +0200
committerZandra Hird <[email protected]>2016-06-10 15:04:27 +0200
commit1553773f77af13e4c8309dea1538ddd4c47b7c5e (patch)
tree702427c3c53dbcc767a0717fa5137434cda7efac /lib/kernel/test/loose_node.erl
parent48acd7ea0ec25625504fe0b3c3afb7c298c562ca (diff)
downloadotp-1553773f77af13e4c8309dea1538ddd4c47b7c5e.tar.gz
otp-1553773f77af13e4c8309dea1538ddd4c47b7c5e.tar.bz2
otp-1553773f77af13e4c8309dea1538ddd4c47b7c5e.zip
kernel: Make sure loose test node is stopped before next test case
Diffstat (limited to 'lib/kernel/test/loose_node.erl')
-rw-r--r--lib/kernel/test/loose_node.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/kernel/test/loose_node.erl b/lib/kernel/test/loose_node.erl
index 93530c2735..cc3f9bbea0 100644
--- a/lib/kernel/test/loose_node.erl
+++ b/lib/kernel/test/loose_node.erl
@@ -57,9 +57,16 @@
%%
stop(Node) when is_atom(Node) ->
+ erlang:monitor_node(Node, true),
rpc:cast(Node, erlang, halt, []),
- io:format("Stopped loose node ~p~n", [Node]),
- ok.
+ receive
+ {nodedown, Node} ->
+ io:format("Stopped loose node ~p~n", [Node]),
+ ok
+ after 10000 ->
+ io:format("Failed to stop loose node: ~p~n", [Node]),
+ {error, node_not_stopped}
+ end.
start(Name, Args) ->
start(Name, Args, -1).