[erlang-bugs] common_test + test_server_io errors
Peter Andersson
peppe@REDACTED
Wed Aug 14 16:34:08 CEST 2013
Hi Tim,
Thanks for all the useful info!
I haven't actually run any tests on this myself, only read some code so
far. Obviously the init and terminate hook functions get called before the
test server process is even started. In other words, these functions
actually execute in that short "evil" window during startup when you can't
call pal/2 or log/2. I missed that. :-( Sorry for misleading you!
Let me dig into this properly and get back to you when I can propose
useful (tested!) solutions to your problems!
Best,
Peter
Ericsson AB, Erlang/OTP
On Wed, 14 Aug 2013, Tim Watson wrote:
> On 14 August 2013 12:09, Tim Watson <watson.timothy@REDACTED> wrote:
>
>> When I execute a test run with this code in place however, I still get the
>> crash, though the io:format/2 notice that I'm starting the ct log appears
>> first:
>>
>> Common Test starting (cwd is
>> /home/t4/work/vmware/rabbitmq-public-umbrella/rabbitmq-test/multi-node)
>>
>> starting ct log!
>>
>>
>> ct_util_server got EXIT from <0.61.0>: {noproc,
>> {gen_server,call,
>> [test_server_io,
>> {print,xxxFrom,unexpected_io,
>> [[[["<div
>> class=\"default\"><b>*** User 2013-08-14 12:02:36.830 ***</b>"],
>>
>> "\n",
>>
>> [91,102,114,97,109,101,119,111,
>> 114,107,93,32,119,97,116,99,
>>
>> 104,100,111,103,58,32,110,111,
>>
>> 32,112,114,111,99,115,32,116,
>>
>> 111,32,107,105,108,108,"\n"]],
>> "\n","</div>"]]},
>> infinity]}}
>>
>>
>> So it appears that the assertion that logging will work between the hook's
>> init and terminate callbacks isn't quite working.
>>
>>
> Oh and I've tried pausing between the systest_ct_log:start/0 call and the
> (latter) systest:reset/0 call that triggers the logging, but that didn't
> make any difference either - e.g., like so:
>
> init(systest, Opts) ->
> case application:start(systest, permanent) of
> {error, {already_started, systest}} -> io:format("starting ct
> log!~n"),
> systest_ct_log:start(),
> receive
> foobar -> ok
> after 2000 -> ok
> end,
> systest:reset();
> {error, _Reason}=Err -> Err;
> ok -> ok
> end,
>
More information about the erlang-bugs
mailing list