You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2003/09/12 04:30:15 UTC

new in Apache::Test: t/SMOKE -bug_mode

It all started when I have noticed a few core files after running t/SMOKE on 
modperl-2.0's top-level test suite. I couldn't figure out which test caused 
them. So I have decided to rewrite the smoker to provide me that information. 
In the future we might autoextract the backtrace as well.

While working on it, I said, we also have a problem of mapping error_log 
errors to the tests that caused them. So I've added logic to extract only the 
relevant (added since the last successful test) part of error_log and 
access_log and print it out, in addition to the output of the client.

This mode also turns the tracing level to -trace=debug, so if the test fails 
and there were any debug printings in the handlers they will be run as well.

This should make bug reports much more useful. However it comes at a price of 
running much slower than the normal 'make test' would do, until 
Test::Harness::Straps won't provide the callbacks to be run after each test, 
eventually we might fold it back to 'make test'. but for now if your 'make 
test' fails, run 't/SMOKE -bug_report'.

Of course the normal t/SMOKE run now reports core files as well, as soon as 
they happen.

You will need to update the current modperl-2.0 cvs to get this functionality. 
Please report any problems that you may have noticed.

So here is how the new log will look:

/home/stas/apache.org/portland3> t/SMOKE -bug_mode
running t/TEST in the bug report mode
apache/add_config............ok
apache/cgihandler............ok
apache/conftree..............ok
apache/constants.............ok
apache/cookie................FAILED
------------------------------------------------------------
                 *** run log ***
     *** setting ulimit to allow core files
     ulimit -c unlimited; ./TEST -verbose -run 'apache/cookie.t'
     apache/cookie....1..2
     # Running under perl version 5.008001 for linux
     # Current time local: Thu Sep 11 18:45:28 2003
     # Current time GMT:   Fri Sep 12 01:45:28 2003
     # Using Test.pm version 1.24
     request has failed (the response code was: 500)
     see t/logs/error_log for more details
     dubious
         Test returned status 255 (wstat 65280, 0xff00)
     DIED. FAILED tests 1-2
         Failed 2/2 tests, 0.00% okay
     Failed Test     Stat Wstat Total Fail  Failed  List of Failed
 
-------------------------------------------------------------------------------
     apache/cookie.t  255 65280     2    4 200.00%  1-2
     !!! error running tests (please examine t/logs/error_log)

                 *** /home/stas/apache.org/portland3/t/logs/error_log ***
     [Thu Sep 11 18:45:28 2003] [error] [client 127.0.0.1] I shouldn't get the 
cookie at /home/stas/apache.org/portland3/t/response/TestApache/cookie.pm line 16.


                 *** /home/stas/apache.org/portland3/t/logs/access_log ***
     127.0.0.1 - - [11/Sep/2003:18:45:28 -0700] "GET 
/TestApache__cookie?header HTTP/1.0" 500 536

------------------------------------------------------------
apache/cookie2...............ok
apache/post..................ok
apache/read..................FAILED
------------------------------------------------------------
                 *** run log ***
     *** setting ulimit to allow core files
     ulimit -c unlimited; ./TEST -verbose -run 'apache/read.t'
     apache/read....Bareword "asdfag" not allowed while "strict subs" in use 
at apache/read.t line 18.
     Execution of apache/read.t aborted due to compilation errors.
     dubious
         Test returned status 255 (wstat 65280, 0xff00)
     !!! error running tests (please examine t/logs/error_log)

------------------------------------------------------------
apache/scanhdrs..............ok
apache/scanhdrs2.............ok
apache/send_cgi_header.......ok
apache/subprocess............ok
apache/write.................FAILED
------------------------------------------------------------
                 *** run log ***
     *** setting ulimit to allow core files
     ulimit -c unlimited; ./TEST -verbose -run 'apache/write.t'
     apache/write....request has failed (the response code was: 500)
     see t/logs/error_log for more details
     dubious
         Test returned status 255 (wstat 65280, 0xff00)
     !!! error running tests (please examine t/logs/error_log)
     !!! oh nuts, server dumped core
     !!! for stacktrace, run: gdb /home/stas/httpd/prefork/bin/httpd -core 
/home/stas/apache.org/portland3/t/core.7604

                 *** /home/stas/apache.org/portland3/t/logs/error_log ***
     [Thu Sep 11 18:46:03 2003] [notice] child pid 7604 exit signal Aborted 
(6), possible coredump in /home/stas/apache.org/portland3/t

------------------------------------------------------------
api/access...................ok
api/aplog....................ok
api/conn_rec.................ok
api/lookup_uri...............ok
api/lookup_uri2..............ok
api/module...................ok
api/r_subclass...............ok
api/request_rec..............ok
api/response.................ok
api/rflush...................ok
api/rutil....................ok
api/sendfile.................ok
api/server_rec...............ok
api/server_util..............ok
api/slurp_filename...........ok
api/uri......................ok
apr-ext/perlio...............ok
apr-ext/table................ok
apr-ext/uuid.................ok
apr/base64...................ok
apr/constants................ok
apr/date.....................ok
apr/netlib...................ok
apr/os.......................ok
apr/perlio...................ok
apr/pool.....................ok
apr/socket...................ok
apr/string...................ok
apr/table....................ok
apr/threadmutex..............ok
apr/util.....................ok
apr/uuid.....................ok
compat/apache................ok
compat/apache_file...........ok
compat/apache_table..........ok
compat/apache_uri............ok
compat/apache_util...........ok
compat/conn_authen...........ok
compat/request...............ok
compat/request_body..........ok
compat/send_fd...............ok
directive/env................ok
directive/perl...............ok
directive/perldo.............ok
directive/perlloadmodule.....ok
directive/perlloadmodule2....ok
directive/perlloadmodule3....ok
directive/perlloadmodule4....ok
directive/perlloadmodule5....ok
directive/perlloadmodule6....ok
directive/perlmodule.........ok
directive/perlrequire........ok
directive/pod................ok
directive/setupenv...........ok
error/api....................ok
error/push_handlers..........ok
error/runtime................ok
error/syntax.................ok
filter/both_str_con_add......ok
filter/both_str_req_add......ok
filter/both_str_req_mix......ok
filter/in_bbs_body...........ok
filter/in_bbs_consume........ok
filter/in_bbs_msg............ok
filter/in_bbs_underrun.......ok
filter/in_init_basic.........ok
filter/in_str_consume........ok
filter/in_str_declined.......ok
filter/in_str_lc.............ok
filter/in_str_msg............ok
filter/in_str_sandwich.......ok
filter/out_bbs_basic.........ok
filter/out_bbs_ctx...........ok
filter/out_init_basic........ok
filter/out_str_api...........ok
filter/out_str_ctx...........ok
filter/out_str_declined......ok
filter/out_str_lc............ok
filter/out_str_remove........ok
filter/out_str_req_eos.......ok
filter/out_str_req_mix.......ok
filter/out_str_reverse.......ok
hooks/access.................ok
hooks/authen.................ok
hooks/authz..................ok
hooks/cleanup................ok
hooks/cleanup2...............ok
hooks/fixup..................ok
hooks/headerparser...........ok
hooks/init...................ok
hooks/push_handlers..........ok
hooks/stacked_handlers.......ok
hooks/stacked_handlers2......ok
hooks/trans..................ok
modperl/current_callback.....ok
modperl/dir_config...........ok
modperl/endav................ok
modperl/env..................ok
modperl/exit.................ok
modperl/getc.................ok
modperl/method...............ok
modperl/methodname...........ok
modperl/methodobj............ok
modperl/perl.................ok
modperl/pnotes...............ok
modperl/post_utf8............ok
modperl/print................ok
modperl/print_utf8...........ok
modperl/print_utf8_2.........ok
modperl/printf...............ok
modperl/readline.............ok
modperl/request_rec_tie_api..ok
modperl/sameinterp...........ok
modperl/setauth..............ok
modperl/subenv...............ok
modperl/taint................ok
modules/cgi..................ok
modules/cgiupload............ok
modules/include..............ok
modules/include2.............ok
modules/proxy................ok
perl/ithreads................ok
perl/ithreads2...............ok
preconnection/note...........ok
protocol/echo................ok
protocol/echo_filter.........ok
protocol/eliza...............ok
------------------------------------------------------------
error running 3 tests out of 140

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: new in Apache::Test: t/SMOKE -bug_mode

Posted by Stas Bekman <st...@stason.org>.
Rafael Garcia-Suarez wrote:
> Stas Bekman wrote:
> 
>>It all started when I have noticed a few core files after running t/SMOKE on 
>>modperl-2.0's top-level test suite. I couldn't figure out which test caused 
>>them. So I have decided to rewrite the smoker to provide me that information. 
>>In the future we might autoextract the backtrace as well.
> 
> 
> Neat. (autoextracting the backtrace automatically is easily done with gdb -x
> where available.)

I didn't know about this option. It doesn't seem to exist on gdb/linux (I have 
the very latest one 5.3-22mdk).

There is also a very old Devel::CoreStack, which doesn't quite work if the gdb 
takes more than one TTY screen to get to the trace. I couldn't figure out how 
to circumvent the 'next page' prompt. Instead I wrote (Debug::FaultAutoBT)
http://search.cpan.org/search?query=Debug%3A%3AFaultAutoBT&mode=module, which 
traps segfaults and gets the backtrace without needed a core file. However it 
requires more work as it doesn't always work. It's modeled after the KDE 
bug-report utility, which pops a bug report window when some KDE-app crashes 
and shows you the backtrace immediately.

>>This should make bug reports much more useful. However it comes at a price of 
>>running much slower than the normal 'make test' would do, until 
>>Test::Harness::Straps won't provide the callbacks to be run after each test, 
>  
> Just in case you don't know this already, the latest Test::Harness
> contains an experimental -- and undocumented -- form of callbacks.
 >
> If you could post something to perl-qa to explain in a
> few sentences what you need, I'd be happy to help crafting
> something. And to reuse it for perl :)

That's exactly why I have mentioned Test::Harness::Straps, I have submitted a 
request for the callback feature, and that's when Andy Lester has mentioned 
the experimental feature in Test::Harness::Straps. All needed is the ability 
to install a hook to be run after each test is finished (and purhaps before 
it). Then one can add various useful procedures to happen between each test 
(e.g. core file finder).


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: new in Apache::Test: t/SMOKE -bug_mode

Posted by Stas Bekman <st...@stason.org>.
Rafael Garcia-Suarez wrote:
> Stas Bekman wrote:
> 
>>It all started when I have noticed a few core files after running t/SMOKE on 
>>modperl-2.0's top-level test suite. I couldn't figure out which test caused 
>>them. So I have decided to rewrite the smoker to provide me that information. 
>>In the future we might autoextract the backtrace as well.
> 
> 
> Neat. (autoextracting the backtrace automatically is easily done with gdb -x
> where available.)

I didn't know about this option. It doesn't seem to exist on gdb/linux (I have 
the very latest one 5.3-22mdk).

There is also a very old Devel::CoreStack, which doesn't quite work if the gdb 
takes more than one TTY screen to get to the trace. I couldn't figure out how 
to circumvent the 'next page' prompt. Instead I wrote (Debug::FaultAutoBT)
http://search.cpan.org/search?query=Debug%3A%3AFaultAutoBT&mode=module, which 
traps segfaults and gets the backtrace without needed a core file. However it 
requires more work as it doesn't always work. It's modeled after the KDE 
bug-report utility, which pops a bug report window when some KDE-app crashes 
and shows you the backtrace immediately.

>>This should make bug reports much more useful. However it comes at a price of 
>>running much slower than the normal 'make test' would do, until 
>>Test::Harness::Straps won't provide the callbacks to be run after each test, 
>  
> Just in case you don't know this already, the latest Test::Harness
> contains an experimental -- and undocumented -- form of callbacks.
 >
> If you could post something to perl-qa to explain in a
> few sentences what you need, I'd be happy to help crafting
> something. And to reuse it for perl :)

That's exactly why I have mentioned Test::Harness::Straps, I have submitted a 
request for the callback feature, and that's when Andy Lester has mentioned 
the experimental feature in Test::Harness::Straps. All needed is the ability 
to install a hook to be run after each test is finished (and purhaps before 
it). Then one can add various useful procedures to happen between each test 
(e.g. core file finder).


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: new in Apache::Test: t/SMOKE -bug_mode

Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Stas Bekman wrote:
> It all started when I have noticed a few core files after running t/SMOKE on 
> modperl-2.0's top-level test suite. I couldn't figure out which test caused 
> them. So I have decided to rewrite the smoker to provide me that information. 
> In the future we might autoextract the backtrace as well.

Neat. (autoextracting the backtrace automatically is easily done with gdb -x
where available.)

> This should make bug reports much more useful. However it comes at a price of 
> running much slower than the normal 'make test' would do, until 
> Test::Harness::Straps won't provide the callbacks to be run after each test, 

Just in case you don't know this already, the latest Test::Harness
contains an experimental -- and undocumented -- form of callbacks.

If you could post something to perl-qa to explain in a
few sentences what you need, I'd be happy to help crafting
something. And to reuse it for perl :)

Re: new in Apache::Test: t/SMOKE -bug_mode

Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Stas Bekman wrote:
> It all started when I have noticed a few core files after running t/SMOKE on 
> modperl-2.0's top-level test suite. I couldn't figure out which test caused 
> them. So I have decided to rewrite the smoker to provide me that information. 
> In the future we might autoextract the backtrace as well.

Neat. (autoextracting the backtrace automatically is easily done with gdb -x
where available.)

> This should make bug reports much more useful. However it comes at a price of 
> running much slower than the normal 'make test' would do, until 
> Test::Harness::Straps won't provide the callbacks to be run after each test, 

Just in case you don't know this already, the latest Test::Harness
contains an experimental -- and undocumented -- form of callbacks.

If you could post something to perl-qa to explain in a
few sentences what you need, I'd be happy to help crafting
something. And to reuse it for perl :)