in reply to Re^5: Failing Tests in MozRepl
in thread Failing Tests in MozRepl

Thanks again.
I ran the install several times, the first failure happens only sometimes (approx. half of the runs). The second errors appear always. It's running on my home machine under no load at all (but it is an older Pentium 4): tested with just fvwm2, firefox and cpan running.

Replies are listed 'Best First'.
Re^7: Failing Tests in MozRepl
by Corion (Patriarch) on Feb 12, 2012 at 14:01 UTC

    This is really weird, this seems to be a peculiarity of your setup. As most tests are passing, I would venture that it's safe to force-install, but it seems that at least sending cookies when downloading a file is broken.

    I can't reproduce the problem locally, so maybe there is some finer stuff in the module (or software) versions. The output of this test file looks for me as follows:

    #!perl -T use strict; use warnings; use Test::More tests => 1; my $module; BEGIN { $module = "WWW::Mechanize::Firefox"; require_ok( $module ); } diag( sprintf "Testing %s %s, Perl %s", $module, $module->VERSION, $] +); for (sort grep /\.pm\z/, keys %INC) { s/\.pm\z//; s!/!::!g; eval { diag(join(' ', $_, $_->VERSION || '<unknown>')) }; } __END__ > perl -Ilib -wT t\00-load.t 1..1 ok 1 - require WWW::Mechanize::Firefox; # Testing WWW::Mechanize::Firefox 0.59, Perl 5.012001 # AutoLoader 5.70 # CPAN::Meta::YAML 0.003 # Carp 1.16 # Config <unknown> # Cwd 3.31 # DynaLoader 1.10 # Encode 2.39 # Encode::Alias 2.12 # Encode::Config 2.05 # Encode::Encoding 2.05 # Exporter 5.64_01 # Exporter::Heavy 5.64_01 # Fcntl 1.06 # File::Basename 2.78 # File::HomeDir::Driver 0.98 # File::Spec 3.31 # File::Spec::Unix 3.3 # File::Spec::Win32 3.3 # FileHandle 2.02 # Firefox::Application 0.59 # HTML::Selector::XPath 0.06 # HTTP::Cookies 6.00 # HTTP::Cookies::MozRepl 0.59 # HTTP::Cookies::Netscape 6.00 # HTTP::Date 6.00 # HTTP::Headers 6.00 # HTTP::Headers::Util 6.00 # HTTP::Message 6.02 # HTTP::Response 6.01 # HTTP::Status 6.00 # IO 1.25_02 # IO::File 1.14 # IO::Handle 1.28 # IO::Seekable 1.1 # JSON 2.53 # JSON::XS 2.3 # List::Util 1.23 # MIME::Base64 3.09 # MozRepl::RemoteObject 0.29 # MozRepl::RemoteObject::Methods 0.29 # Parse::CPAN::Meta 1.4401 # PerlIO 1.06 # Portable 0.13 # Portable::CPAN 0.13 # Portable::Config 0.13 # Portable::HomeDir 0.13 # Portable::minicpan 0.13 # Scalar::Util 1.23 # SelectSaver 1.02 # Storable 2.22 # Symbol 1.07 # Test::Builder 0.98 # Test::Builder::Module 0.98 # Test::More 0.98 # Time::HiRes 1.9721 # Time::Local 1.1901_01 # URI 1.54 # URI::Escape 3.30 # WWW::Mechanize::Firefox 0.59 # WWW::Mechanize::Link <unknown> # XSLoader 0.10 # attributes 0.12 # base 2.15 # bytes 1.04 # common::sense 3.4 # constant 1.20 # overload 1.10 # parent 0.223 # re 0.11 # strict 1.04 # utf8 1.08 # vars 1.01 # warnings 1.09 # warnings::register 1.01

    But I doubt that the difference really lies on the Perl side of things. Modifying t/50-app-new.t to also output the mozrepl version shows for my test setup that the tests pass across 1.1beta2 and 1.1.0:

    eval { @addons = $ff->addons; $lives++ }; ok $lives, "We can query the addons" or diag $@; diag "Found " . scalar @addons . " addons"; ok @addons >= 1, "You have at least one addon"; # The mozrepl addo +n, duh my ($mozrepl) = grep { $_->{id} eq 'mozrepl@hyperstruct.net' } @ad +dons; isn't $mozrepl, undef, "We find the mozrepl addon"; is $mozrepl->{name}, 'MozRepl', 'The name is "MozRepl"'; diag "Using MozRepl version $mozrepl->{version}";

    If you have any other mozrepl version, that could be an easy solution, but you already said you use 1.1.0.

      Thank you for your comments. Eventually, I was able to pass the tests, making these changes: Changes 1, 2, and 4 are just 1 second sleeps after a get; change 5 prolongs the cookies to 2 minutes (sometimes, 50 seconds was enough, but sometimes not, 120 is a safe guess). Change 3 makes the SKIP work - last cannot work without a block (2/12 Label not found for "last SKIP" at /usr/lib/perl5/5.14.2/Test/More.pm line 1256.) In some tests, Time::HiRes is used, but not really used.

      Especially the cookie thing makes me wonder what could be the cause.

        Ouch - that skip block for Image::Info is a real bug in the tests.

        The rest really has me stumped. It really seems as if your machine is heavily loaded or unresponsive, but that's highly unlikely for a single-user machine... Especially that making the cookie timeout longer helps would mean that it takes more than five seconds to retrieve the cookie via mozrepl.