Skip Menu |

This queue is for tickets about the LWP-UserAgent-WithCache CPAN distribution.

Report information
The Basics
Id: 94510
Status: resolved
Priority: 0/
Queue: LWP-UserAgent-WithCache

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Test suite started to fail
Beginning with 2013-07-29 21:06, all test runs seem to fail. See here: http://matrix.cpantesters.org/?dist=LWP%3A%3AUserAgent%3A%3AWithCache;reports=1#sl=7,1 Maybe a test URL is not valid anymore? Regards, Slaven
On 2014-04-07 14:37:16, SREZIC wrote: Show quoted text
> Beginning with 2013-07-29 21:06, all test runs seem to fail. See here: > http://matrix.cpantesters.org/?dist=LWP%3A%3AUserAgent%3A%3AWithCache;reports=1#sl=7,1 > > Maybe a test URL is not valid anymore?
Yes, http://www.example.com/styles.css does not work. There's no web server at www.example.com anymore.
On 2015-06-27 04:07:26, SREZIC wrote: Show quoted text
> On 2014-04-07 14:37:16, SREZIC wrote:
> > Beginning with 2013-07-29 21:06, all test runs seem to fail. See > > here: > > http://matrix.cpantesters.org/?dist=LWP%3A%3AUserAgent%3A%3AWithCache;reports=1#sl=7,1 > > > > Maybe a test URL is not valid anymore?
> > Yes, http://www.example.com/styles.css does not work. There's no web > server at www.example.com anymore.
Actually, there are two possible failure modes: * On FreeBSD 9.x systems, the default name server configuration will point example.com to 127.0.0.1, and the name www.example.com causes a resolve error. So on these systems an lwp request to www.example.com will cause a "Name or service not known" error * On other systems where www.example.com resolves to the remote machine owned by IANA, http://www.example.com/styles.css will cause a 404 error. So using any example.com URL is currently not advisable for testing.
On 2015-09-26 14:06:58, SREZIC wrote: Show quoted text
> On 2015-06-27 04:07:26, SREZIC wrote:
> > On 2014-04-07 14:37:16, SREZIC wrote:
> > > Beginning with 2013-07-29 21:06, all test runs seem to fail. See > > > here: > > > http://matrix.cpantesters.org/?dist=LWP%3A%3AUserAgent%3A%3AWithCache;reports=1#sl=7,1 > > > > > > Maybe a test URL is not valid anymore?
> > > > Yes, http://www.example.com/styles.css does not work. There's no web > > server at www.example.com anymore.
> > Actually, there are two possible failure modes: > > * On FreeBSD 9.x systems, the default name server configuration will > point example.com to 127.0.0.1, and the name www.example.com causes a > resolve error. So on these systems an lwp request to www.example.com > will cause a "Name or service not known" error > > * On other systems where www.example.com resolves to the remote > machine owned by IANA, http://www.example.com/styles.css will cause a > 404 error. > > So using any example.com URL is currently not advisable for testing.
A patch is attached (and also available at CPAN from my patches directory: http://cpan.cpantesters.org/authors/id/S/SR/SREZIC/patches/LWP-UserAgent-WithCache-0.12-RT94510.patch ) This changes the test to use search.cpan.org's favicon URL. I thought about using a metacpan URL first, but metacpan does not have any http locations, just https, and I don't want to force LWP::Protocol::https as a dependency. Changing the static http responses in the test script was not necessary.
Subject: LWP-UserAgent-WithCache-0.12-RT94510.patch
From 3c37730e0b29604ab1251a8a3e0fe3fd78f45295 Mon Sep 17 00:00:00 2001 From: Slaven Rezic <slaven@rezic.de> Date: Sat, 26 Sep 2015 22:02:13 +0200 Subject: [PATCH] use a working test URL The www.example.org URL is non-existent or even not reachable, so use a working one. This fixes RT #94510. --- t/10_request.t | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/t/10_request.t b/t/10_request.t index dde1f96..7f02983 100644 --- a/t/10_request.t +++ b/t/10_request.t @@ -7,6 +7,8 @@ my $tempdir = tempdir( CLEANUP => 1 ); my $ua = LWP::UserAgent::WithCache->new({ cache_root => $tempdir }); +my $uri = 'http://search.cpan.org/favicon.ico'; + my $res; { $res = HTTP::Response->parse(<<'EOF'); @@ -30,9 +32,8 @@ Client-Response-Num: 1 /* end StyleCatcher imports */ EOF -my $uri = 'http://www.example.com/styles.css'; $ua->set_cache($uri, $res); -my $cached_res = $ua->get('http://www.example.com/styles.css'); +my $cached_res = $ua->get($uri); is ($cached_res->code, 200); } @@ -57,9 +58,8 @@ Expires: Thr, 16 Jan 2038 03:14:06 GMT /* end StyleCatcher imports */ EOF -my $uri = 'http://www.example.com/styles.css'; $ua->set_cache($uri, $res); -my $cached_res = $ua->get('http://www.example.com/styles.css'); +my $cached_res = $ua->get($uri); is ($cached_res->code, 200); } @@ -91,14 +91,13 @@ Last-Modified: Thr, 01 Jan 1970 00:00:00 GMT EOF -my $uri = 'http://www.example.com/styles.css'; $ua->set_cache($uri, $res); ## override request method to get not_modified_res no warnings 'redefine'; local *LWP::UserAgent::request = sub {return $not_modified_res}; -my $cached_res = $ua->get('http://www.example.com/styles.css'); +my $cached_res = $ua->get($uri); is ($cached_res->code, 200); is ($cached_res->content, $res->content); -- 2.1.2
On 2015-09-26 16:13:02, SREZIC wrote: Show quoted text
> On 2015-09-26 14:06:58, SREZIC wrote:
> > On 2015-06-27 04:07:26, SREZIC wrote:
> > > On 2014-04-07 14:37:16, SREZIC wrote:
> > > > Beginning with 2013-07-29 21:06, all test runs seem to fail. See > > > > here: > > > > http://matrix.cpantesters.org/?dist=LWP%3A%3AUserAgent%3A%3AWithCache;reports=1#sl=7,1 > > > > > > > > Maybe a test URL is not valid anymore?
> > > > > > Yes, http://www.example.com/styles.css does not work. There's no > > > web > > > server at www.example.com anymore.
> > > > Actually, there are two possible failure modes: > > > > * On FreeBSD 9.x systems, the default name server configuration will > > point example.com to 127.0.0.1, and the name www.example.com causes a > > resolve error. So on these systems an lwp request to www.example.com > > will cause a "Name or service not known" error > > > > * On other systems where www.example.com resolves to the remote > > machine owned by IANA, http://www.example.com/styles.css will cause a > > 404 error. > > > > So using any example.com URL is currently not advisable for testing.
> > A patch is attached (and also available at CPAN from my patches > directory: > http://cpan.cpantesters.org/authors/id/S/SR/SREZIC/patches/LWP- > UserAgent-WithCache-0.12-RT94510.patch ) > > This changes the test to use search.cpan.org's favicon URL. I thought > about using a metacpan URL first, but metacpan does not have any http > locations, just https, and I don't want to force LWP::Protocol::https > as a dependency. Changing the static http responses in the test script > was not necessary.
In the meanwhile this patch does not work anymore. My proposed test URL returns a 404 nowadays. But maybe this could be changed to use metacpan.org's favicon.ico. I can create a patch or pull request...
On 2019-09-05 15:33:47, SREZIC wrote: Show quoted text
> On 2015-09-26 16:13:02, SREZIC wrote:
> > On 2015-09-26 14:06:58, SREZIC wrote:
> > > On 2015-06-27 04:07:26, SREZIC wrote:
> > > > On 2014-04-07 14:37:16, SREZIC wrote:
> > > > > Beginning with 2013-07-29 21:06, all test runs seem to fail. > > > > > See > > > > > here: > > > > > http://matrix.cpantesters.org/?dist=LWP%3A%3AUserAgent%3A%3AWithCache;reports=1#sl=7,1 > > > > > > > > > > Maybe a test URL is not valid anymore?
> > > > > > > > Yes, http://www.example.com/styles.css does not work. There's no > > > > web > > > > server at www.example.com anymore.
> > > > > > Actually, there are two possible failure modes: > > > > > > * On FreeBSD 9.x systems, the default name server configuration > > > will > > > point example.com to 127.0.0.1, and the name www.example.com causes > > > a > > > resolve error. So on these systems an lwp request to > > > www.example.com > > > will cause a "Name or service not known" error > > > > > > * On other systems where www.example.com resolves to the remote > > > machine owned by IANA, http://www.example.com/styles.css will cause > > > a > > > 404 error. > > > > > > So using any example.com URL is currently not advisable for > > > testing.
> > > > A patch is attached (and also available at CPAN from my patches > > directory: > > http://cpan.cpantesters.org/authors/id/S/SR/SREZIC/patches/LWP- > > UserAgent-WithCache-0.12-RT94510.patch ) > > > > This changes the test to use search.cpan.org's favicon URL. I thought > > about using a metacpan URL first, but metacpan does not have any http > > locations, just https, and I don't want to force LWP::Protocol::https > > as a dependency. Changing the static http responses in the test > > script > > was not necessary.
> > In the meanwhile this patch does not work anymore. My proposed test > URL returns a 404 nowadays. But maybe this could be changed to use > metacpan.org's favicon.ico. I can create a patch or pull request...
Revised patch: https://github.com/sekimura/lwp-useragent-withcache/pull/4