diff options
author | Siri Hansen <[email protected]> | 2012-12-19 16:02:18 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-12-20 16:44:05 +0100 |
commit | 8100f5b8156a446081813fc8167059171d90b817 (patch) | |
tree | 013ef1024ad104c5407a82aa31b2c023804ada7b /lib/test_server/test | |
parent | f6eb49df376b56f746c2e74d8cf159261aee5464 (diff) | |
download | otp-8100f5b8156a446081813fc8167059171d90b817.tar.gz otp-8100f5b8156a446081813fc8167059171d90b817.tar.bz2 otp-8100f5b8156a446081813fc8167059171d90b817.zip |
[test_server] Stop cover on node after node is terminated
Before terminating slave nodes, test_server calls cover:flush/1 to
fetch data from the node without actually stopping cover on this
node. If cover is not stopped for the node and a new node with the
same name is started, then cover will be started on the new node. To
avoid this test_server now calls cover:stop/1 after the slave node is
terminated.
Diffstat (limited to 'lib/test_server/test')
-rw-r--r-- | lib/test_server/test/test_server_test_lib.erl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/test_server/test/test_server_test_lib.erl b/lib/test_server/test/test_server_test_lib.erl index 4e89abf308..d466aa0110 100644 --- a/lib/test_server/test/test_server_test_lib.erl +++ b/lib/test_server/test/test_server_test_lib.erl @@ -83,14 +83,21 @@ start_slave(Config,_Level) -> post_end_per_testcase(_TC, Config, Return, State) -> Node = proplists:get_value(node, Config), - case test_server:is_cover() of - true -> - cover:flush(Node); - false -> - ok + 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, {Return, State}. %% Parse an .suite log file |