From 42c31ab4bfcd74d7139f90ea1b03a35048cacef6 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 26 Mar 2013 14:40:36 +0100 Subject: [cover] Ensure no process leak when stopping cover on dead node When cover:stop(Node) was called on a non-existing node, a process waiting for cover data from the node would hang forever. This has been corrected. --- lib/tools/test/cover_SUITE.erl | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'lib/tools/test') diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl index 5abc5c41b1..c033be98a3 100644 --- a/lib/tools/test/cover_SUITE.erl +++ b/lib/tools/test/cover_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2001-2012. All Rights Reserved. +%% Copyright Ericsson AB 2001-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -27,7 +27,8 @@ dont_reconnect_after_stop/1, stop_node_after_disconnect/1, export_import/1, otp_5031/1, eif/1, otp_5305/1, otp_5418/1, otp_6115/1, otp_7095/1, - otp_8188/1, otp_8270/1, otp_8273/1, otp_8340/1]). + otp_8188/1, otp_8270/1, otp_8273/1, otp_8340/1, + otp_10979_hanging_node/1]). -include_lib("test_server/include/test_server.hrl"). @@ -52,7 +53,7 @@ all() -> dont_reconnect_after_stop, stop_node_after_disconnect, export_import, otp_5031, eif, otp_5305, otp_5418, otp_6115, otp_7095, otp_8188, otp_8270, otp_8273, - otp_8340]; + otp_8340, otp_10979_hanging_node]; _pid -> {skip, "It looks like the test server is running " @@ -1381,6 +1382,25 @@ comprehension_8188(Cf) -> ok. +otp_10979_hanging_node(_Config) -> + + P1 = processes(), + + cover:stop(non_existing_node), + cover:stop(), + + P2 = processes(), + + case P2--P1 of + [] -> + ok; + New -> + [io:format("New: ~p, ~p~n",[P,process_info(P)]) || P<-New], + ct:fail(hanging_process) + end, + + ok. + %%--Auxiliary------------------------------------------------------------ analyse_expr(Expr, Config) -> -- cgit v1.2.3