Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Shorten CPAN distribution.

Report information
The Basics
Id: 88052
Status: resolved
Priority: 0/
Queue: WWW-Shorten

People
Owner: DAVECROSS [...] cpan.org
Requestors: KENTNL [...] cpan.org
SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Randomly fails t/tinyurl.t

Not sure if this is HARNESS_OPTIONS=j100 based or just intermittent network raceconditions or not.

Doesn't happen every time, just every so often.

t/newnames.t ..... ok                                                   
===(      31;1  1/7  2/6 )==============================================
#   Failed test 'make it longer'
#   at t/tinyurl.t line 10.
#          got: undef
#     expected: 'http://search.cpan.org/dist/WWW-Shorten/'
t/metamark.t ..... ok                                                   
t/tinyurl.t ...... 6/6 # Looks like you failed 1 test of 6.
t/tinyurl.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests

Test Summary Report
-------------------
t/tinyurl.t    (Wstat: 256 Tests: 6 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1


t/newnames.t ..... ok                                                   
t/linkz.t ........ ok                                                   
===(      31;1  2/7  1/6 )==============================================
#   Failed test 'make it shorter'
#   at t/tinyurl.t line 9.
#          got: undef
#     expected: 'http://tinyurl.com/c338s4'
t/metamark.t ..... ok                                                   
t/tinyurl.t ...... 4/6 # Looks like you failed 1 test of 6.
t/tinyurl.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests

Test Summary Report
-------------------
t/tinyurl.t    (Wstat: 256 Tests: 6 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1

It fails roughly 1 in 20 times,  and the worst failure case is this:

 

t/newnames.t ..... ok                                                   
===(      30;0  1/7  1/6 )==============================================Use of uninitialized value $return in pattern match (m//) at t/tinyurl.t line 7.
Use of uninitialized value $code in concatenation (.) or string at t/tinyurl.t line 9.
===(      31;1  1/7  2/6 )==============================================
#   Failed test 'make it shorter'
#   at t/tinyurl.t line 9.
#          got: undef
#     expected: 'http://tinyurl.com/'
Use of uninitialized value $code in concatenation (.) or string at t/tinyurl.t line 10.

#   Failed test 'make it longer'
#   at t/tinyurl.t line 10.
#          got: undef
#     expected: 'http://search.cpan.org/dist/WWW-Shorten/'
No TinyURL key / URL passed to makealongerlink at t/tinyurl.t line 11.
# Looks like you planned 6 tests but ran 3.
# Looks like you failed 2 tests of 3 run.
# Looks like your test exited with 255 just after 3.
t/tinyurl.t ...... Dubious, test returned 255 (wstat 65280, 0xff00)     
Failed 5/6 subtests
t/metamark.t ..... ok   

Test Summary Report
-------------------
t/tinyurl.t    (Wstat: 65280 Tests: 3 Failed: 2)
  Failed tests:  2-3
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 6 tests but ran 3.

But its always tinyurl, nothing else:

wget http://cpan.metacpan.org/authors/id/D/DA/DAVECROSS/WWW-Shorten-3.04.tar.gz -O /tmp/WWW-Shorten-3.04.tar.gz && for i in $(seq 1 100); do HARNESS_OPTIONS=j100:c cpanm -v /tmp/WWW-Shorten-3.04.tar.gz ; echo $i; done
 

On Fri Aug 23 05:40:19 2013, KENTNL wrote: Show quoted text
> Not sure if this is HARNESS_OPTIONS=j100 based or just intermittent > network raceconditions or not. > > Doesn't happen every time, just every so often.
Yeah. It's been happening intermittently for years. I should really look into this in a bit more detail. Dave...
I released a new version of WWW::Shorten last night, which was supposed to fix this error. But it didn't :-( Investigations continue.
On 2014-05-07 09:28:48, DAVECROSS wrote: Show quoted text
> I released a new version of WWW::Shorten last night, which was > supposed to fix this error. > > But it didn't :-( > > Investigations continue.
According to http://url-shorteners.public-website-status.com/7827/120756/tinyurl.com the availability of tinyurl.com is not very good. For the current week (Nov 10 - Nov 16) I see numbers between 80% and 86%.
On 2014-05-07 09:28:48, DAVECROSS wrote: Show quoted text
> I released a new version of WWW::Shorten last night, which was > supposed to fix this error. > > But it didn't :-( > > Investigations continue.
Maybe it would be best to move WWW::Shorten::TinyURL into an own CPAN distribution? (For me, installing WWW::Shorten fails for every new perl because of the t/tinyurl.t problem)
Not a bad idea. But it'll take a little work as TinyURL is currently the default shortener that the package uses. I'm fast runing out of URL shorteners :-)
The random failures are due to the service putting limits on the non-official API service that the module uses. Tracking of progress to move to the official API will take place in GitHub's issues here: https://github.com/p5-shorten/www-shorten/issues/7 Thanks, Chase