Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0702-mnesia-Reduce-io-and-crashreports-from-tes...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0702-mnesia-Reduce-io-and-crashreports-from-test-runs.patch of Package erlang
From 85c4022622525e9a26a72813fc0aaffdaa54132d Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson <dgud@erlang.org> Date: Wed, 27 Oct 2021 12:10:35 +0200 Subject: [PATCH 2/3] mnesia: Reduce io and crashreports from test runs Avoid crashreports for every testcase which starts with killing any mnesia node. And do not log the initialization in the plugins, which is also done in every testcase. --- lib/mnesia/src/mnesia.erl | 11 ++++++----- lib/mnesia/src/mnesia_sup.erl | 18 +++++++++++++++--- lib/mnesia/test/ext_test.erl | 7 ++----- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl index 028deccea4..0d139e7867 100644 --- a/lib/mnesia/src/mnesia.erl +++ b/lib/mnesia/src/mnesia.erl @@ -316,28 +316,30 @@ kill() -> ms() -> [ + mnesia_sup, + mnesia_kernel_sup, + mnesia_checkpoint_sup, + mnesia_snmp_sup, + mnesia_ext_sup, + mnesia, mnesia_app, mnesia_backup, mnesia_bup, mnesia_checkpoint, - mnesia_checkpoint_sup, mnesia_controller, mnesia_dumper, mnesia_loader, mnesia_frag, mnesia_frag_hash, mnesia_index, - mnesia_kernel_sup, mnesia_late_loader, mnesia_lib, mnesia_log, mnesia_registry, mnesia_schema, mnesia_snmp_hook, - mnesia_snmp_sup, mnesia_subscr, - mnesia_sup, mnesia_text, mnesia_tm, mnesia_recover, @@ -345,7 +347,6 @@ ms() -> %% Keep these last in the list, so %% mnesia_sup kills these last - mnesia_ext_sup, mnesia_monitor, mnesia_event ]. diff --git a/lib/mnesia/src/mnesia_sup.erl b/lib/mnesia/src/mnesia_sup.erl index fd5156d2a4..6deda768ec 100644 --- a/lib/mnesia/src/mnesia_sup.erl +++ b/lib/mnesia/src/mnesia_sup.erl @@ -88,13 +88,25 @@ add_event_handler() -> kill() -> Mnesia = [mnesia_fallback | mnesia:ms()], - Kill = fun(Name) -> try exit(whereis(Name), kill) catch _:_ -> ok end end, + Kill = fun + (mnesia_sup) -> + try %% Avoid crash reports + Sup = whereis(mnesia_sup), + {_,Dict} = process_info(Sup, dictionary), + [App] = proplists:get_value('$ancestors', Dict), + unlink(App), + exit(Sup, kill), + App ! {'EXIT', Sup, normal} + catch _:_ -> ok end; + (Name) -> + try exit(whereis(Name), kill) catch _:_ -> ok end + end, lists:foreach(Kill, Mnesia), lists:foreach(fun ensure_dead/1, Mnesia), timer:sleep(10), case lists:keymember(mnesia, 1, application:which_applications()) of - true -> kill(); - false -> ok + true -> kill(); + false -> ok end. ensure_dead(Name) -> diff --git a/lib/mnesia/test/ext_test.erl b/lib/mnesia/test/ext_test.erl index cd39f4a6f1..a95c804486 100644 --- a/lib/mnesia/test/ext_test.erl +++ b/lib/mnesia/test/ext_test.erl @@ -70,15 +70,12 @@ semantics(_Alias, _) -> init_backend() -> ?DBG(init_backend), - ct:log("init_backend ~p", [?MODULE]), %% cheat and stuff a marker in mnesia_gvar K = backend_init_marker(), case try mnesia_lib:val(K) catch _:_ -> error end of error -> - ct:log("BACKEND marker will be inserted (~p)", [?MODULE]), mnesia_lib:set(K, true); Other -> - ct:log("BACKEND marker already present (~p)", [?MODULE]), error({backend_already_initialized, {?MODULE, Other}}) end, ok. @@ -88,7 +85,7 @@ backend_init_marker() -> add_aliases(_As) -> ?DBG(_As), - ct:log("add_aliases(~p)", [_As]), + %ct:log("add_aliases(~p)", [_As]), true = mnesia_lib:val(backend_init_marker()), ok. @@ -148,7 +145,7 @@ receiver_first_message(Sender, {first, Size}, _Alias, Tab) -> ?DBG({first,Size}), {Size, {Tab, Sender}}. -receive_data(Data, ext_ets, Name, _Sender, {Name, Tab, _Sender}=State) -> +receive_data(Data, ext_ets, Name, Sender, {Name, Tab, Sender}=State) -> ?DBG({Data,State}), true = ets:insert(Tab, Data), {more, State}; -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor