Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 42703
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: ed [...] litmusgreen.com
Marek.Rouchal [...] gmx.net
Cc:
AdminCc:

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



Subject: t/cookies test has problems with proxies
If environment variables are set for proxies (http_proxy etc.) the t/cookies.t fails with my perl-5.8.8 (sitting behind a firewall). The patch below corrects that by unsetting the proxy vars before they can do any harm. All tests of 1.54 then pass OK. Cheers, Marek --- WWW-Mechanize-1.54/t/cookies.t 2009-01-12 07:37:37.000000000 +0100 +++ WWW-Mechanize-1.54p1/t/cookies.t 2009-01-23 08:37:19.000000000 +0100 @@ -1,6 +1,10 @@ #!/usr/bin/perl -w # XXX add cookie reading on the server side to the test +BEGIN { + # proxy is evil + delete @ENV{qw(http_proxy https_proxy no_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY)}; +}
Subject: Cookie tests fail in proxy environment
Date: Wed, 4 Mar 2009 13:46:53 -0600
To: bug-WWW-Mechanize [...] rt.cpan.org
From: Ed Silva <ed [...] litmusgreen.com>
We have a proxy for outside connections and when installing WWW::Mechanize via CPAN the cookie tests fail, since they are not using the proxy: t/cookies................2/14 # Failed test 'First fetch works' # at t/cookies.t line 69. # got: '500' # expected: '200' # Failed test 'First cookie matches' # at t/cookies.t line 73. # got: undef # expected: 'Cookie #1' # Failed test 'Right title' # at t/cookies.t line 74. # got: undef # expected: 'Home of Cookie #1' Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 106, <DATA> line 16. Use of uninitialized value in numeric ge (>=) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 114, <DATA> line 16. Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 123, <DATA> line 16. Use of uninitialized value in concatenation (.) or string at /usr/lib/ perl5/site_perl/5.8.5/HTTP/Cookies.pm line 129, <DATA> line 16. Use of uninitialized value in numeric ge (>=) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 130, <DATA> line 16. t/cookies................5/14 # Failed test 'Second fetch works' # at t/cookies.t line 79. # got: '503' # expected: '200' # Failed test 'Second cookie matches' # at t/cookies.t line 83. # got: undef # expected: 'Cookie #2' # Failed test 'Right title' # at t/cookies.t line 84. # got: 'Network Error' # expected: 'Home of Cookie #2' # Failed test 'Cookie did not change...' # at t/cookies.t line 92. # got: undef # expected: 'Cookie #2' # Failed test '... but back to the first page title' # at t/cookies.t line 93. # got: undef # expected: 'Home of Cookie #1' Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 106, <DATA> line 16. Use of uninitialized value in numeric ge (>=) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 114, <DATA> line 16. Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 123, <DATA> line 16. Use of uninitialized value in concatenation (.) or string at /usr/lib/ perl5/site_perl/5.8.5/HTTP/Cookies.pm line 129, <DATA> line 16. Use of uninitialized value in numeric ge (>=) at /usr/lib/perl5/ site_perl/5.8.5/HTTP/Cookies.pm line 130, <DATA> line 16. Maybe test for connectivity and skip if you can't talk to the outside world? Cheers, --Ed
I'm seeing the same behavior on this module
On Fri Jan 23 02:50:15 2009, MAREKR wrote: Show quoted text
> If environment variables are set for proxies (http_proxy etc.) the > t/cookies.t fails with my perl-5.8.8 (sitting behind a firewall). The > patch below corrects that by unsetting the proxy vars before they can > do any harm. All tests of 1.54 then pass OK. > Cheers, > Marek
Fix is (somewhat) confirmed: same can be done by unsetting those variables at the shell before invoking cpan{,p} install of the module.
Duplicate of ticket #42703
Subject: Re: [rt.cpan.org #42703] t/cookies test has problems with proxies
Date: Thu, 30 Apr 2009 20:52:17 +0200
To: <bug-WWW-Mechanize [...] rt.cpan.org>
From: "Marek Rouchal" <mrouchal [...] arcor.de>
That's true - if you're however running the CPAN shell behind a firewall, you will have to set *_proxy so that CPAN can download the modules - and these environment Variables are inherited by the build/install processes. So it would be nice if the tests just unset them... Show quoted text
-----Ursprüngliche Nachricht----- Fix is (somewhat) confirmed: same can be done by unsetting those variables at the shell before invoking cpan{,p} install of the module.
I confirm the problem and the fix. It would be nice to get this into the next release. -Ken
Fixed in 1.55_01.