aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/doc/src/ct.xml2
-rw-r--r--lib/common_test/src/ct_logs.erl5
-rw-r--r--lib/common_test/src/ct_master_logs.erl2
-rw-r--r--lib/common_test/src/cth_log_redirect.erl9
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl10
5 files changed, 18 insertions, 10 deletions
diff --git a/lib/common_test/doc/src/ct.xml b/lib/common_test/doc/src/ct.xml
index 5231ef24a4..264bcff251 100644
--- a/lib/common_test/doc/src/ct.xml
+++ b/lib/common_test/doc/src/ct.xml
@@ -935,7 +935,7 @@
</func>
<func>
- <name>reload_config(Required) -&gt; ValueOrElement</name>
+ <name>reload_config(Required) -&gt; ValueOrElement | {error, Reason}</name>
<fsummary>Reloads configuration file containing specified configuration
key.</fsummary>
<type>
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 455864efb6..53245c596a 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -137,7 +137,8 @@ close(Info, StartDir) ->
%% so we need to use a local copy of the log cache data
LogCacheBin =
case make_last_run_index() of
- {error,_} -> % log server not responding
+ {error, Reason} -> % log server not responding
+ io:format("Warning! ct_logs not responding: ~p~n", [Reason]),
undefined;
LCB ->
LCB
@@ -240,7 +241,7 @@ call(Msg) ->
Pid ->
MRef = erlang:monitor(process,Pid),
Ref = make_ref(),
- ?MODULE ! {Msg,{self(),Ref}},
+ Pid ! {Msg,{self(),Ref}},
receive
{Ref, Result} ->
erlang:demonitor(MRef, [flush]),
diff --git a/lib/common_test/src/ct_master_logs.erl b/lib/common_test/src/ct_master_logs.erl
index a2542171f8..52003f752d 100644
--- a/lib/common_test/src/ct_master_logs.erl
+++ b/lib/common_test/src/ct_master_logs.erl
@@ -560,7 +560,7 @@ get_format_args(Content) ->
make_dir(Dir) ->
case file:make_dir(Dir) of
- {error, exist} ->
+ {error, eexist} ->
ok;
Else ->
Else
diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl
index 33a3813a16..6d77d7ee9e 100644
--- a/lib/common_test/src/cth_log_redirect.erl
+++ b/lib/common_test/src/cth_log_redirect.erl
@@ -127,7 +127,7 @@ handle_event(Event, #eh_state{log_func = LogFunc} = State) ->
_Else ->
{ok, ErrLogType} = application:get_env(sasl, errlog_type),
SReport = sasl_report:format_report(group_leader(), ErrLogType,
- tag_event(Event)),
+ tag_event(Event, local)),
if is_list(SReport) ->
SaslHeader = format_header(State),
case LogFunc of
@@ -142,8 +142,9 @@ handle_event(Event, #eh_state{log_func = LogFunc} = State) ->
ignore
end
end,
+ %% note that error_logger (unlike sasl) expects UTC time
EReport = error_logger_tty_h:write_event(
- tag_event(Event),io_lib),
+ tag_event(Event, utc), io_lib),
if is_list(EReport) ->
ErrHeader = format_header(State),
case LogFunc of
@@ -220,7 +221,9 @@ terminate(_) ->
terminate(_Arg, _State) ->
ok.
-tag_event(Event) ->
+tag_event(Event, utc) ->
+ {calendar:universal_time(), Event};
+tag_event(Event, _) ->
{calendar:local_time(), Event}.
set_curr_func(CurrFunc, Config) ->
diff --git a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl
index 7b9b5687e5..bd1ac54781 100644
--- a/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/cth_log_SUITE.erl
@@ -40,6 +40,7 @@ suite() ->
%% @end
%%--------------------------------------------------------------------
init_per_suite(Config) ->
+ application:start(sasl),
Gen = spawn(fun() -> gen() end),
[{gen,Gen}|Config].
@@ -52,6 +53,7 @@ end_per_suite(Config) ->
Gen = proplists:get_value(gen, Config),
exit(Gen, kill),
ct:sleep(100),
+ application:stop(sasl),
ok.
%%--------------------------------------------------------------------
@@ -90,7 +92,8 @@ end_per_testcase(_TestCase, _Config) ->
%% @end
%%--------------------------------------------------------------------
groups() ->
- [{g1,[parallel,{repeat,10}],[tc1,tc2,tc3]}].
+ [{g1,[parallel,{repeat,10}],[tc1,tc2,tc3]},
+ {g2,[{repeat,10}],[tc1,tc2,tc3]}].
%%--------------------------------------------------------------------
%% @spec all() -> GroupsAndTestCases | {skip,Reason}
@@ -101,7 +104,7 @@ groups() ->
%% @end
%%--------------------------------------------------------------------
all() ->
- [{group,g1}].
+ [{group,g1},{group,g2}].
tc1(_) ->
ct:sleep(100),
@@ -121,5 +124,6 @@ gen() ->
gen_loop(N) ->
ct:log("Logger iteration: ~p", [N]),
error_logger:error_report(N),
- ct:sleep(200),
+ error_logger:info_report(progress, N),
+ ct:sleep(150),
gen_loop(N+1).