Skip Menu |

This queue is for tickets about the Starlet CPAN distribution.

Report information
The Basics
Id: 105006
Status: open
Priority: 0/
Queue: Starlet

People
Owner: Nobody in particular
Requestors: pthirose [...] ucdavis.edu
Cc:
AdminCc:

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



Subject: baybridge.jpg in Plack-1.0036 changed, fails test 08chunked
Date: Fri, 5 Jun 2015 19:43:03 +0000
To: "bug-starlet [...] rt.cpan.org" <bug-starlet [...] rt.cpan.org>
From: Paul Hirose <pthirose [...] ucdavis.edu>
Between Place 1.0034 and 1.0036, the file Plack-1.0036/shared/baybridge.jpg changed in size from 79838 bytes to 14750 bytes, which in turn causes your test 08 to fail. This has been driving me nuts for a few hours, until I finally narrowed it down :) I copied the previous jpg to my current perl install .../lib/site_perl/5.22.0/auto/share/dist/Plack/baybridge.jpg and then ran cpanm Plack::Handler::Starlet and it was quite happy. I ran into this, when installing Request-Tracker and using perlbrew w/the latest 5.22.0. But this also happened with perlbrew and 5.20.2 as well. It's really not a Request Tracker or a perlbrew thing (I don't think) but I just wanted to FYI you the context, in case you needed it. PH == Paul Hirose University of California, Davis pthirose@ucdavis.edu
Subject: [rt.cpan.org #105006]
Date: Sat, 06 Jun 2015 10:21:42 -0500
To: bug-starlet [...] rt.cpan.org
From: jeff [...] ifworld.com
Thanks to Paul for sniffing this out. I can confirm the failing test, but not the fix. Using plenv 5.20.2 on Wheezy/Vagrant, I replaced the file as Paul suggested, but test08 still failed. I ended up editing the test (lines 188 and 189, respectively) to match the file size and hash, after which building Plack::Handler::Starlet succeeded. build.log --------- cpanm (App::cpanminus) 1.7035 on perl 5.020002 built for x86_64-linux Work directory is /home/vagrant/.cpanm/work/1433602312.1760 You have make /usr/bin/make You have LWP 6.13 You have /bin/tar: tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. Searching Plack::Handler::Starlet () on cpanmetadb ... --> Working on Plack::Handler::Starlet Fetching http://www.cpan.org/authors/id/K/KA/KAZUHO/Starlet-0.24.tar.gz -> OK Unpacking Starlet-0.24.tar.gz Entering Starlet-0.24 Checking configure dependencies from META.yml Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.04) Configuring Starlet-0.24 Running Makefile.PL Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Starlet Writing MYMETA.yml and MYMETA.json -> OK Checking dependencies from MYMETA.json ... Checking if you have Server::Starter 0.06 ... Yes (0.30) Checking if you have Test::More 0.88 ... Yes (1.001014) Checking if you have Test::TCP 0.15 ... Yes (2.12) Checking if you have Parallel::Prefork 0.13 ... Yes (0.17) Checking if you have Plack 0.992 ... Yes (1.0036) Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.04) Checking if you have LWP::UserAgent 5.8 ... Yes (6.13) Building and testing Starlet-0.24 cp lib/Starlet.pm blib/lib/Starlet.pm cp lib/Starlet/Server.pm blib/lib/Starlet/Server.pm cp lib/Plack/Handler/Starlet.pm blib/lib/Plack/Handler/Starlet.pm Manifying 1 pod document PERL_DL_NONLAZY=1 "/home/vagrant/.plenv/versions/5.20.2/bin/perl5.20.2" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t start_server (pid:1938) starting now... starting new worker 1939 Plack::Handler::Starlet: Accepting connections at http://0:51359/ 127.0.0.1 - - [06/Jun/2015:07:52:05 -0700] "GET / HTTP/1.1" 200 5 "-" "libwww-perl/6.13" received TERM, sending TERM to all workers:1939 worker 1939 died, status:0 exiting t/00base.t ................. ok # Failed test at /home/vagrant/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Plack/Test/Suite.pm line 188. # got: '79838' # expected: '14750' # Failed test at /home/vagrant/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Plack/Test/Suite.pm line 189. # got: '983726ae0e4ce5081bef5fb2b7216950' # expected: '70546a79c7abb9c497ca91730a0686e4' # Looks like you failed 2 tests of 102. t/01plack-test.t ........... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/102 subtests 1963 at t/02graceful.t line 11. 1963 at t/02graceful.t line 30. 1966 at t/02graceful.t line 16. t/02graceful.t ............. ok 1977 at t/03post.t line 9. Plack::Handler::Starlet: Accepting connections at http://0:50114/ 127.0.0.1 - - [06/Jun/2015:07:52:10 -0700] "POST / HTTP/1.1" 200 3 "-" "libwww-perl/6.13" t/03post.t ................. ok t/04-bumpy-life.t .......... ok t/05server-header.t ........ ok t/06harakiri.t ............. ok t/07remote_port.t .......... ok t/08chunked_req.t .......... ok t/09chunked_zero_length.t .. ok t/10unix_domain_socket.t ... ok t/11multi-sockets.t ........ ok Test Summary Report ------------------- t/01plack-test.t (Wstat: 512 Tests: 102 Failed: 2) Failed tests: 33-34 Non-zero exit status: 2 Files=12, Tests=140, 18 wallclock secs ( 0.23 usr 0.09 sys + 9.99 cusr 2.76 csys = 13.07 CPU) Result: FAIL Failed 1/12 test programs. 2/140 subtests failed. make: *** [test_dynamic] Error 255 -> FAIL Installing Plack::Handler::Starlet failed. See /home/vagrant/.cpanm/work/1433602312.1760/build.log for details. Retry with --force to force install it.
Here's a patch to make the test work with older/newer versions of Plack/baybridge.jpg. Tested with Plack 1.0036 and 1.0033. Cheers, gregor, Debian Perl Group
Subject: plack-jpg.patch
Description: baybridge.jpg was resized in 1.0035 check for old and new size/md5sum Origin: vendor Bug: https://rt.cpan.org/Public/Bug/Display.html?id=105006 Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=105006 Bug-Debian: https://bugs.debian.org/#789669 Author: gregor herrmann <gregoa@debian.org> Last-Update: 2015-06-23 --- a/t/08chunked_req.t +++ b/t/08chunked_req.t @@ -1,5 +1,6 @@ use strict; use Test::TCP; +use Plack; use Plack::Test; use File::ShareDir; use HTTP::Request; @@ -35,8 +36,19 @@ my $res = $cb->($req); - is $res->header('X-Content-Length'), 79838; - is Digest::MD5::md5_hex($res->content), '983726ae0e4ce5081bef5fb2b7216950'; + # baybridge.jpg was resized in 1.0035 + my ($imgsize, $imgmd5); + diag ("Testing with baybridge.jpg from Plack $Plack::VERSION"); + if ($Plack::VERSION >= 1.0035) { + $imgsize = 14750; + $imgmd5 = '70546a79c7abb9c497ca91730a0686e4'; + } else { + $imgsize = 79838; + $imgmd5 = '983726ae0e4ce5081bef5fb2b7216950'; + } + + is $res->header('X-Content-Length'), $imgsize; + is Digest::MD5::md5_hex($res->content), $imgmd5; }; done_testing;
The fix in Starman is much more elegant: https://github.com/miyagawa/Starman/commit/a45d712d38a9454d3d5a7d12de0dd741f24d8bed Cheers, gregor