Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dancer CPAN distribution.

Report information
The Basics
Id: 48440
Status: resolved
Priority: 0/
Queue: Dancer

People
Owner: Nobody in particular
Requestors: enric.joffrion [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.9902
Fixed in: (no value)



Subject: cpan installation failed test
perl version : 5.8.5 One test : t/03_route_handler/003_error_warning_catching.t. doesn't seem to pass. Don't really know if this is my configuration ? here is a part of the log installation. .... t/03_route_handler/002_before_filter.t ........... ok t/03_route_handler/003_error_warning_catching.t .. Argument "hello" isn't numeric in addition (+) at t/03_route_handler/003_error_warning_catching.t line 13, <DATA> line 16. t/03_route_handler/003_error_warning_catching.t .. 1/2 # Failed test 'response looks good for /warning' # at t/03_route_handler/003_error_warning_catching.t line 30. # '1' # doesn't match '(?-xism:Argument "hello" isn't numeric in addition)' # Looks like you failed 1 test of 2. t/03_route_handler/003_error_warning_catching.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests t/04_static_file/001_base.t ...................... ok ... t/07_http_request/001_basic_request.t ............ ok Test Summary Report ------------------- t/03_route_handler/003_error_warning_catching.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=24, Tests=177, 4 wallclock secs ( 0.12 usr 0.05 sys + 2.69 cusr 0.32 csys = 3.18 CPU) Result: FAIL Failed 1/24 test programs. 1/177 subtests failed. make: *** [test_dynamic] Erreur 255 SUKRIA/Dancer-0.9902.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports SUKRIA/Dancer-0.9902.tar.gz Running make install make test had returned bad status, won't install without force
Hello Enric and thanks a lot for giving Dancer a try! That's weird, that test does pass on my test boxes (Debian etch and Ubuntu 9.04): $ PERL5LIB=./lib perl t/03_route_handler/05_error_catching.t 1..2 ok 1 - response looks good for /error ok 2 - response looks good for /warning In the git version the test as been renamed, but it didn't change at all. It seems that, in your environment, Dancer does not manage to trap the warning triggered by the following line: my $bar = 1 + "hello" The revelant code is in the method Dancer::Route->call() : <pre> sub call($$) { ... # catch warnings my $warn; local $SIG{__WARN__} = sub { $warn = $_[0] }; # eval the route handler eval { $content = $handler->{code}->() }; # trap errors if ($@ || $warn) { Dancer::SharedData->reset_all(); return { head => {status => 'error', content_type => 'text/plain'}, body => "Route Handler Error\n\n$warn\n$@", }; } </pre> It seems that for a strange reason, the __WARN__ catch failed...
Well, reading the error again, the problem comes because the warning doesn't get trirggered. I can reproduce the bug if I disable the warnings after Dancer is loaded in the test script (Dancer loads automatically strictness and warnings): in the testscript: ... use Dancer; no warnings; ... Then: $ PERL5LIB=./lib perl t/03_route_handler/05_error_catching.t 1..2 ok 1 - response looks good for /error not ok 2 - response looks good for /warning # Failed test 'response looks good for /warning' # at t/03_route_handler/05_error_catching.t line 31. # '1' # doesn't match '(?-xism:Argument "hello" isn't numeric in addition)' # Looks like you failed 1 test of 2. That's the same error, now, the question is: how the hell do the warnings get shut down on your system? :-)
Bug fixed in the Git Repo: http://github.com/sukria/Dancer/commit/027127e6dcbf781995f2783f4f5a6d1fb9ab8248 Will be uploaded as 0.9003 on CPAN
bug fixed in last version (1.110)