diff options
author | Peter Andersson <[email protected]> | 2017-12-04 16:01:06 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2017-12-04 16:01:06 +0100 |
commit | 333556f4323f8d8a9e22a613a8591032b84b28d8 (patch) | |
tree | fb2b191cdf6433f637e1ee998000d9f38e96a0f9 /lib/common_test/src/ct_run.erl | |
parent | 1a5dd04e0958681a72984eba6b3cf026aaec0155 (diff) | |
parent | 378da5aef27e1679aa30b8f4a2a6569accb70ff2 (diff) | |
download | otp-333556f4323f8d8a9e22a613a8591032b84b28d8.tar.gz otp-333556f4323f8d8a9e22a613a8591032b84b28d8.tar.bz2 otp-333556f4323f8d8a9e22a613a8591032b84b28d8.zip |
Merge branch 'peppe/common_test/auto_cleanup/OTP-13832' into maint
* peppe/common_test/auto_cleanup/OTP-13832:
Add tests and doc for the new remaining_test_procs function
Implement function that finds disposable test processes
Tag Common Test system processes using process dictionary
Add app name tag in process dictionary
OTP-13832
Diffstat (limited to 'lib/common_test/src/ct_run.erl')
-rw-r--r-- | lib/common_test/src/ct_run.erl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl index 14f28f9ca3..05b1e70098 100644 --- a/lib/common_test/src/ct_run.erl +++ b/lib/common_test/src/ct_run.erl @@ -250,6 +250,8 @@ finish(Tracing, ExitStatus, Args) -> end. script_start1(Parent, Args) -> + %% tag this process + ct_util:mark_process(), %% read general start flags Label = get_start_opt(label, fun([Lbl]) -> Lbl end, Args), Profile = get_start_opt(profile, fun([Prof]) -> Prof end, Args), @@ -956,7 +958,10 @@ run_test(StartOpts) when is_list(StartOpts) -> -spec run_test1_fun(_) -> fun(() -> no_return()). run_test1_fun(StartOpts) -> - fun() -> run_test1(StartOpts) end. + fun() -> + ct_util:mark_process(), + run_test1(StartOpts) + end. run_test1(StartOpts) when is_list(StartOpts) -> case proplists:get_value(refresh_logs, StartOpts) of @@ -1447,7 +1452,10 @@ run_testspec(TestSpec) -> -spec run_testspec1_fun(_) -> fun(() -> no_return()). run_testspec1_fun(TestSpec) -> - fun() -> run_testspec1(TestSpec) end. + fun() -> + ct_util:mark_process(), + run_testspec1(TestSpec) + end. run_testspec1(TestSpec) -> {ok,Cwd} = file:get_cwd(), @@ -1906,10 +1914,12 @@ possibly_spawn(true, Tests, Skip, Opts) -> CTUtilSrv = whereis(ct_util_server), Supervisor = fun() -> + ct_util:mark_process(), process_flag(trap_exit, true), link(CTUtilSrv), TestRun = fun() -> + ct_util:mark_process(), TestResult = (catch do_run_test(Tests, Skip, Opts)), case TestResult of {EType,_} = Error when EType == user_error; |