diff options
author | Zandra Hird <[email protected]> | 2016-06-09 14:40:22 +0200 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2016-06-09 14:40:22 +0200 |
commit | 75e5cdabbcaaa12f043225ca8d361055a9d47b24 (patch) | |
tree | 6c3abd0e228d33dcd7f40d909fda885fea2b8738 /lib/common_test/src/ct_master.erl | |
parent | 6a47b7c2c6cd467257e0bc65b8a0fa8ecd74cc13 (diff) | |
parent | 02564a09a8df4cd0cd8e6e53b7e3a3107e3229d7 (diff) | |
download | otp-75e5cdabbcaaa12f043225ca8d361055a9d47b24.tar.gz otp-75e5cdabbcaaa12f043225ca8d361055a9d47b24.tar.bz2 otp-75e5cdabbcaaa12f043225ca8d361055a9d47b24.zip |
Merge branch 'zandra/common_test/unmatched_returns/OTP-13345'
* zandra/common_test/unmatched_returns/OTP-13345: (23 commits)
ct logs: Fix unmatched_return warnings
ct_util: Fix unmatched_return warnings
erl2html2: Fix unmatched_return warnings
cth_conn_log: Fix unmatched_return warnings
ct_webtool: Fix unmatched_return warnings
ct_telnet: Fix unmatched_return warnings
ct_ssh: Fix unmatched_return warnings
ct_snmp: Fix unmatched_return warnings
ct_slave: Fix unmatched_return warnings
ct_rpc: Fix unmatched_return warnings
ct_repeat: Fix unmatched_return warnings
ct_release_test: Fix unmatched_return warnings
ct_property_test: Fix unmatched_return warnings
ct_master: Fix unmatched_return warnings
ct_hooks_lock: Fix unmatched_return warnings
ct_hooks: Fix unmatched_return warnings
ct_groups: Fix unmatched_return warnings
ct_ftp: Fix unmatched_return warnings
ct_framework: Fix unmatched_return warnings
ct_config: Fix unmatched_return warnings
...
Diffstat (limited to 'lib/common_test/src/ct_master.erl')
-rw-r--r-- | lib/common_test/src/ct_master.erl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/common_test/src/ct_master.erl b/lib/common_test/src/ct_master.erl index c4905b316f..4eef27d2a5 100644 --- a/lib/common_test/src/ct_master.erl +++ b/lib/common_test/src/ct_master.erl @@ -376,7 +376,7 @@ init_master(Parent,NodeOptsList,EvHandlers,MasterLogDir,LogDirs, end, %% start master event manager and add default handler - ct_master_event:start_link(), + {ok, _} = start_ct_master_event(), ct_master_event:add_handler(), %% add user handlers for master event manager Add = fun({H,Args}) -> @@ -398,6 +398,14 @@ init_master(Parent,NodeOptsList,EvHandlers,MasterLogDir,LogDirs, end, init_master1(Parent,NodeOptsList,InitOptions,LogDirs). +start_ct_master_event() -> + case ct_master_event:start_link() of + {error, {already_started, Pid}} -> + {ok, Pid}; + Else -> + Else + end. + init_master1(Parent,NodeOptsList,InitOptions,LogDirs) -> {Inaccessible,NodeOptsList1,InitOptions1} = init_nodes(NodeOptsList, InitOptions), @@ -658,7 +666,7 @@ refresh_logs([D|Dirs],Refreshed) -> {ok,Cwd} = file:get_cwd(), case catch ct_run:refresh_logs(D) of {'EXIT',Reason} -> - file:set_cwd(Cwd), + ok = file:set_cwd(Cwd), refresh_logs(Dirs,[{D,{error,Reason}}|Refreshed]); Result -> refresh_logs(Dirs,[{D,Result}|Refreshed]) @@ -701,7 +709,7 @@ init_node_ctrl(MasterPid,Cookie,Opts) -> end, %% start a local event manager - ct_event:start_link(), + {ok, _} = start_ct_event(), ct_event:add_handler([{master,MasterPid}]), %% log("Running test with options: ~p~n", [Opts]), @@ -721,6 +729,14 @@ init_node_ctrl(MasterPid,Cookie,Opts) -> "Can't report result!~n~n", [MasterNode]) end. +start_ct_event() -> + case ct_event:start_link() of + {error, {already_started, Pid}} -> + {ok, Pid}; + Else -> + Else + end. + %%%----------------------------------------------------------------- %%% Event handling %%%----------------------------------------------------------------- @@ -778,7 +794,7 @@ reply(Result,To) -> ok. init_nodes(NodeOptions, InitOptions)-> - ping_nodes(NodeOptions), + _ = ping_nodes(NodeOptions), start_nodes(InitOptions), eval_on_nodes(InitOptions), {Inaccessible, NodeOptions1}=ping_nodes(NodeOptions), |