diff options
author | Peter Andersson <[email protected]> | 2012-08-23 15:11:06 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-08-23 15:15:46 +0200 |
commit | 55a885431333e263228e069c2aa7d56ec8e2b25c (patch) | |
tree | 4b4a0e4cbb0cd5170e075fefb392eeab9516f3a7 /lib/common_test/src/ct_logs.erl | |
parent | db5288a7ee4a60aff143f65b90a2bebcbe1bf15d (diff) | |
parent | e711632042d1538fce80d565a2add309a88efa1b (diff) | |
download | otp-55a885431333e263228e069c2aa7d56ec8e2b25c.tar.gz otp-55a885431333e263228e069c2aa7d56ec8e2b25c.tar.bz2 otp-55a885431333e263228e069c2aa7d56ec8e2b25c.zip |
Merge remote branch 'origin/peppe/common_test/ct_hooks_errors' into maint
* origin/peppe/common_test/ct_hooks_errors:
Fix IO printout crash caused by hook function
Fix timetrap error in pre-hooks
Conflicts:
lib/common_test/src/cth_surefire.erl
OTP-10050
OTP-10069
OTP-10072
Diffstat (limited to 'lib/common_test/src/ct_logs.erl')
-rw-r--r-- | lib/common_test/src/ct_logs.erl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index 1ccbdc3718..8359dcee98 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -659,13 +659,23 @@ create_io_fun(FromPid, State) -> print_to_log(sync, FromPid, TCGL, List, State) -> IoFun = create_io_fun(FromPid, State), - io:format(TCGL, "~s", [lists:foldl(IoFun, [], List)]), + %% in some situations (exceptions), the printout is made from the + %% test server IO process and there's no valid group leader to send to + IoProc = if FromPid /= TCGL -> TCGL; + true -> State#logger_state.ct_log_fd + end, + io:format(IoProc, "~s", [lists:foldl(IoFun, [], List)]), State; print_to_log(async, FromPid, TCGL, List, State) -> IoFun = create_io_fun(FromPid, State), + %% in some situations (exceptions), the printout is made from the + %% test server IO process and there's no valid group leader to send to + IoProc = if FromPid /= TCGL -> TCGL; + true -> State#logger_state.ct_log_fd + end, Printer = fun() -> - io:format(TCGL, "~s", [lists:foldl(IoFun, [], List)]) + io:format(IoProc, "~s", [lists:foldl(IoFun, [], List)]) end, case State#logger_state.async_print_jobs of [] -> |