LibreCat / Catmandu-SRU

Catmandu module for working with SRU data.
https://metacpan.org/release/Catmandu-SRU
5 stars 5 forks source link

t/Catmandu-Fix-search_sru.t fails (with Test::HTTP::LocalServer 0.66?) #41

Closed eserte closed 5 years ago

eserte commented 5 years ago

On my smoker systems:

Output from './Build test':

Passed malformed URL: http://[::1]:46249/?version=1.1&operation=searchRetrieve&query=value&recordSchema=oai_dc&startRecord=1&maximumRecords=10 at /usr/home/cpansand/.cpan/build/2019092010/Catmandu-SRU-0.425-3/blib/lib/Catmandu/Importer/SRU.pm line 85.

Trace begun at (eval 121) line 1
Catmandu::Emit::__ANON__('HASH(0x42c91348)') called at /usr/perl5.28.1Dp/lib/site_perl/5.28.1/Catmandu/Fix.pm line 104
Catmandu::Fix::__ANON__('HASH(0x42c91348)') called at /usr/perl5.28.1Dp/lib/site_perl/5.28.1/Catmandu/Fix.pm line 161
Catmandu::Fix::fix('Catmandu::Fix=HASH(0x42a5b3a8)', 'HASH(0x42c91348)') called at /usr/perl5.28.1Dp/lib/site_perl/5.28.1/Catmandu/Fix/Base.pm line 19
Catmandu::Fix::Base::fix('Catmandu::Fix::search_sru=HASH(0x42bf8c18)', 'HASH(0x42c91348)') called at t/Catmandu-Fix-search_sru.t line 19
# Tests were run but no plan was declared and done_testing() was not seen.
t/Catmandu-Fix-search_sru.t ............... 
Dubious, test returned 254 (wstat 65024, 0xfe00)
All 2 subtests passed 

This seems to fail with the latest Test::HTTP::LocalServer. Statistical analysis:

****************************************************************
Regression 'mod:Test::HTTP::LocalServer'
****************************************************************
Name                   Theta          StdErr     T-stat
[0='const']           1.0000          0.0000    15111943508567136.00
[1='eq_0.64']        -0.0000          0.0000      -2.37
[2='eq_0.65']        -0.0000          0.0000      -1.37
[3='eq_0.66']        -1.0000          0.0000    -14548566093984734.00

R^2= 1.000, N= 50, K= 4
****************************************************************
jorol commented 5 years ago

Thanks for the report.

The URL is generated by Test::HTTP::LocalServer and the error massage is thrown by Furl. I will check how to fix this.

nics commented 5 years ago

as a temporary fix 0.426 works around this by only using the port returned by Test::HTTP::LocalServer.

jorol commented 5 years ago

It's a bug in Furl, @Corion submitted an PR https://github.com/tokuhirom/Furl/pull/119

nics commented 5 years ago

temporary fix fails on bsd: http://www.cpantesters.org/cpan/report/941bbfba-dfa1-11e9-9066-e374b0ba08e8

nics commented 5 years ago

switch to HTTP::Tiny? It supports IPv6 and is already used in some Catmandu modules.

Corion commented 5 years ago

The failling machine is likely a dual-interface machine that can run both IPv4 and IPv6, but localhost resolves only on IPv4 but the test uses IPv6 (or vice versa). This is the reason why Test::HTTP::LocalServer uses 127.0.0.1 or ::1 instead of localhost. My suggestion is to either fix Furl or switch away from it. A fix is in tokuhirom/Furl#119 I think.

nics commented 5 years ago

replaced Furl with HTTP:Tiny in 0.427