Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 107252
Status: resolved
Priority: 0/
Queue: LWP-UserAgent-Mockable

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

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



Subject: Test failures if example.com cannot be reached
The test suite fails on all my freebsd smokers, see http://matrix.cpantesters.org/?dist=LWP-UserAgent-Mockable%201.13 First reason is that t/10-basic-record.t is skipped because of use Test::RequiresInternet ('www.example.com' => 80); The smoker machines have internet access, but: the freebsd name server is resolving www.example.com to 127.0.0.1, and there's no web server running on localhost, so Test::RequiresInternet thinks that there's no internet connection. See also https://github.com/freebsd/freebsd-ports/blob/master/dns/bind99/files/named.conf.in#L240 https://github.com/freebsd/freebsd-ports/blob/master/dns/bind99/files/empty.db for the default name server configuration. 10-basic-record.t has the side-effect of creating basic.mockdata which is used in later tests, which are consequently failing: Can't open basic.mockdata: Datei oder Verzeichnis nicht gefunden at /usr/home/eserte/.cpan/build/2015092218/LWP-UserAgent-Mockable-1.13-owid4Z/blib/lib/LWP/UserAgent/Mockable.pm line 73. Compilation failed in require at t/11-basic-playback.t line 14. BEGIN failed--compilation aborted at t/11-basic-playback.t line 14. t/11-basic-playback.t ...................... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run I also can imagine that on other systems with different nameserver configuration the test may fail if the test suite is run in parallel --- in this case the order of executed test files is random. My proposals are: - Use another address for Test::RequiresInternet. Probably it's best to use www.google.com:80, as you're fetching from google anyway. - Skip the 11-basic-playback.t test if basic.mockdata is missing (which can happen in an environment without network, or with shuffled/parallel testing)
On 2015-09-22 15:08:45, SREZIC wrote: Show quoted text
> The test suite fails on all my freebsd smokers, see > http://matrix.cpantesters.org/?dist=LWP-UserAgent-Mockable%201.13 > > First reason is that t/10-basic-record.t is skipped because of > > use Test::RequiresInternet ('www.example.com' => 80); > > The smoker machines have internet access, but: the freebsd name server > is resolving www.example.com to 127.0.0.1, and there's no web server > running on localhost, so Test::RequiresInternet thinks that there's no > internet connection. See also > https://github.com/freebsd/freebsd- > ports/blob/master/dns/bind99/files/named.conf.in#L240 > https://github.com/freebsd/freebsd- > ports/blob/master/dns/bind99/files/empty.db > for the default name server configuration. > > 10-basic-record.t has the side-effect of creating basic.mockdata which > is used in later tests, which are consequently failing: > > Can't open basic.mockdata: Datei oder Verzeichnis nicht gefunden at > /usr/home/eserte/.cpan/build/2015092218/LWP-UserAgent-Mockable-1.13- > owid4Z/blib/lib/LWP/UserAgent/Mockable.pm line 73. > Compilation failed in require at t/11-basic-playback.t line 14. > BEGIN failed--compilation aborted at t/11-basic-playback.t line 14. > t/11-basic-playback.t ...................... > Dubious, test returned 255 (wstat 65280, 0xff00) > No subtests run > > I also can imagine that on other systems with different nameserver > configuration the test may fail if the test suite is run in parallel > --- in this case the order of executed test files is random. > > My proposals are: > > - Use another address for Test::RequiresInternet. Probably it's best > to use www.google.com:80, as you're fetching from google anyway. > > - Skip the 11-basic-playback.t test if basic.mockdata is missing > (which can happen in an environment without network, or with > shuffled/parallel testing)
2nd item is still missing in 1.14. 11-basic-playback.t fails if there's really no network, or the NO_NETWORK_TESTING variable is set. See http://www.cpantesters.org/cpan/report/1538ec9e-61f7-11e5-a8ba-b764b4e1cf47 for a sample report.
Hi, Thanks again - 1.15 should fix this. Only adopted this module the other day and hadn't looked at the tests in any detail. thanks, Michael