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: 30513
Status: rejected
Priority: 0/
Queue: WWW-Mechanize

Owner: Nobody in particular
Requestors: chris+rt [...]

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

Subject: [PATCH] easy fix for t/local/back.t 404 test on machine with invalid hostname
Download (untitled) / with headers
text/plain 1.1k
For several WWW::Mechanize releases, I've been getting HTTP 500 errors on test 28 of t/local/back.t (1.22 worked, everything through 1.32 failed). I finally found the tuits to figure out why. I put a Dumper() call after the failing test and saw this: not ok 28 - 404 check # Failed test '404 check' # at t/local/back.t line 153. # got: '500' # expected: '404' $VAR1 = bless( { 'content' => '500 Can\'t connect to islug:57045 (Bad hostname \'islug\') ', ... That is, my machine has an ad-hoc local hostname which is causing problems. I applied the following simple patch and the test now passes for me. It looks like a very similar solution has been applied in t/local/referer-server. % diff -u t/local/back.t{~,} --- t/local/back.t~ 2007-10-30 11:45:32.000000000 -0500 +++ t/local/back.t 2007-11-05 23:57:21.000000000 -0600 @@ -127,7 +127,8 @@ is( scalar @{$mech->{page_stack}}, 0, 'Pre-404 check' ); my $server404 = HTTP::Daemon->new or die; -my $server404url = $server404->url; +my $server404url = new URI($server404->url); +$server404url->host('localhost'); die 'Cannot fork' if (! defined (my $pid404 = fork())); END {

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

Please report any issues with to