Skip Menu |
 

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 28505
Status: resolved
Priority: 0/
Queue: libwww-perl

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

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



Subject: Today w3.org times out -> Can't call method "find_input"
Download (untitled) / with headers
text/plain 538b
The failure mode would better tell the user that w3.org is running into some timeout. The test actually says: live/validator.........Can't call method "find_input" on an undefined value at live/validator.t line 32. live/validator.........dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED tests 1-2 Failed 2/2 tests, 0.00% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- live/validator.t 9 2304 2 4 1-2
From: JDHEDDEN [...] cpan.org
Download (untitled) / with headers
text/plain 686b
ANDK wrote: Show quoted text
> The failure mode would better tell the user that w3.org is > running into some timeout. The test actually says: > > > live/validator.........Can't call method "find_input" on an undefined > value at live/validator.t line 32. > live/validator.........dubious > Test returned status 9 (wstat 2304, 0x900) > DIED. FAILED tests 1-2 > Failed 2/2 tests, 0.00% okay > Failed Test Stat Wstat Total Fail List of Failed >
------------------------------------------------------------------------------- Show quoted text
> live/validator.t 9 2304 2 4 1-2
The attached patch fixes this by checking its request to w3.org, and skipping the tests if it can't connect.
Download validator_t.patch
text/x-diff 1001b
diff -urN libwww-perl-5.806/t/live/validator.t libwww-perl-patched/t/live/validator.t --- libwww-perl-5.806/t/live/validator.t 2003-01-01 11:46:05.000000000 -0500 +++ libwww-perl-patched/t/live/validator.t 2007-07-30 11:36:33.151411600 -0400 @@ -5,6 +5,13 @@ use LWP::UserAgent; use HTML::Form; +sub skip_it +{ + print("ok 1 # skip $_[0]\n"); + print("ok 2 # skip $_[0]\n"); + exit(0); +} + my $uri = "http://validator.w3.org/file-upload.html"; my $ua = LWP::UserAgent->new(keep_alive => 1); @@ -12,8 +19,10 @@ $req = HTTP::Request->new(GET => $uri); $res = $ua->request($req); +skip_it($res->status_line) if (! $res->is_success); my $f = HTML::Form->parse($res->content, $res->base); +skip_it('No validation form !?!') if (! $f); #$f->dump; @@ -40,7 +49,7 @@ $res = $ua->request($req); #print $res->as_string; -unless ($res->content =~ /found to be valid/) { +unless ($res->content =~ /found\s+to\s+be\s+valid/s) { print $res->as_string; print "\nnot "; }
I got another patch that also fixes this problem which I have applied.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.