aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-01-09 08:51:12 +0100
committerSiri Hansen <[email protected]>2013-01-09 08:51:12 +0100
commit151f7832c74975297b1dce6302dd192285d7c2a8 (patch)
tree3fc10ca9a6c0ef9be212c5bb3e650b865d260abb /lib/common_test/test
parent9767e72b44ebd0cd5277634c4a37318479623c2d (diff)
parent06ad426384ab6c5f5966c4f5ae87be0fb01f346c (diff)
downloadotp-151f7832c74975297b1dce6302dd192285d7c2a8.tar.gz
otp-151f7832c74975297b1dce6302dd192285d7c2a8.tar.bz2
otp-151f7832c74975297b1dce6302dd192285d7c2a8.zip
Merge branch 'siri/cover/new-bugs-r16/OTP-10638'
* siri/cover/new-bugs-r16/OTP-10638: [cover] Cleanup by stopping cover between tests [common_test] Stop cover on slave node after node is terminated [test_server] Stop cover on node after node is terminated [cover] Fix timing dependent bug in cover_SUITE:reconnect [cover] Remove stopped node also from lost_nodes list [cover] Don't mark stopped node as lost
Diffstat (limited to 'lib/common_test/test')
-rw-r--r--lib/common_test/test/ct_test_support.erl31
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index e5e2e68fcb..fc572aa82f 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -117,11 +117,7 @@ end_per_suite(Config) ->
CTNode = proplists:get_value(ct_node, Config),
PrivDir = proplists:get_value(priv_dir, Config),
true = rpc:call(CTNode, code, del_path, [filename:join(PrivDir,"")]),
- case test_server:is_cover() of
- true -> cover:flush(CTNode);
- false -> ok
- end,
- slave:stop(CTNode),
+ slave_stop(CTNode),
ok.
%%%-----------------------------------------------------------------
@@ -152,11 +148,7 @@ end_per_testcase(_TestCase, Config) ->
case wait_for_ct_stop(CTNode) of
%% Common test was not stopped to we restart node.
false ->
- case test_server:is_cover() of
- true -> cover:flush(CTNode);
- false -> ok
- end,
- slave:stop(CTNode),
+ slave_stop(CTNode),
start_slave(Config,proplists:get_value(trace_level,Config)),
{fail, "Could not stop common_test"};
true ->
@@ -1274,3 +1266,22 @@ rm_files([F | Fs]) ->
rm_files([]) ->
ok.
+%%%-----------------------------------------------------------------
+%%%
+slave_stop(Node) ->
+ Cover = test_server:is_cover(),
+ if Cover-> cover:flush(Node);
+ true -> ok
+ end,
+ erlang:monitor_node(Node, true),
+ slave:stop(Node),
+ receive
+ {nodedown, Node} ->
+ if Cover -> cover:stop(Node);
+ true -> ok
+ end
+ after 5000 ->
+ erlang:monitor_node(Node, false),
+ receive {nodedown, Node} -> ok after 0 -> ok end %flush
+ end,
+ ok.