aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/test_server_io.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2017-10-07 00:27:07 +0200
committerPeter Andersson <[email protected]>2017-10-25 17:28:55 +0200
commitca7eb97b48c523cf2eb26d610894f8e3057b7740 (patch)
tree9d50f2d34569e46f13f37f50924f54d2a31a8b8f /lib/common_test/src/test_server_io.erl
parent2df013b5bfd714247570d9b4958b40f7559d35dd (diff)
downloadotp-ca7eb97b48c523cf2eb26d610894f8e3057b7740.tar.gz
otp-ca7eb97b48c523cf2eb26d610894f8e3057b7740.tar.bz2
otp-ca7eb97b48c523cf2eb26d610894f8e3057b7740.zip
Implement function that finds disposable test processes
Diffstat (limited to 'lib/common_test/src/test_server_io.erl')
-rw-r--r--lib/common_test/src/test_server_io.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/common_test/src/test_server_io.erl b/lib/common_test/src/test_server_io.erl
index 09da57e4dd..ef31521950 100644
--- a/lib/common_test/src/test_server_io.erl
+++ b/lib/common_test/src/test_server_io.erl
@@ -263,7 +263,7 @@ handle_call(reset_state, From, #st{phase=stopping,pending_ops=Ops}=St) ->
{Result,NewSt1}
end,
{noreply,St#st{pending_ops=[{From,Op}|Ops]}};
-handle_call(reset_state, _From, #st{fds=Fds,tags=Tags,gls=Gls,
+handle_call(reset_state, _From, #st{fds=Fds,tags=Tags,shared_gl=Shared0,gls=Gls,
offline_buffer=OfflineBuff}) ->
%% close open log files
lists:foreach(fun(Tag) ->
@@ -274,6 +274,7 @@ handle_call(reset_state, _From, #st{fds=Fds,tags=Tags,gls=Gls,
file:close(Fd)
end
end, Tags),
+ test_server_gl:stop(Shared0),
GlList = gb_sets:to_list(Gls),
_ = [test_server_gl:stop(GL) || GL <- GlList],
timer:sleep(100),
@@ -321,7 +322,7 @@ handle_call(finish, From, St) ->
handle_info({'EXIT',Pid,normal}, #st{gls=Gls0,stopping=From}=St) ->
Gls = gb_sets:delete_any(Pid, Gls0),
- case gb_sets:is_empty(Gls) andalso stopping =/= undefined of
+ case gb_sets:is_empty(Gls) andalso From =/= undefined of
true ->
%% No more group leaders left.
gen_server:reply(From, ok),
@@ -330,6 +331,9 @@ handle_info({'EXIT',Pid,normal}, #st{gls=Gls0,stopping=From}=St) ->
%% Wait for more group leaders to finish.
{noreply,St#st{gls=Gls,phase=stopping}}
end;
+handle_info({'EXIT',Pid,killed}, #st{gls=Gls0}=St) ->
+ %% forced termination of group leader
+ {noreply,St#st{gls=gb_sets:delete_any(Pid, Gls0)}};
handle_info({'EXIT',_Pid,Reason}, _St) ->
exit(Reason);
handle_info(stop_group_leaders, #st{gls=Gls}=St) ->