Thank you for your comments. Eventually, I was able to pass the tests, making these changes:
--- t/49-mech-nav.t~ 2012-02-12 12:07:33.000000000 +0100
+++ t/49-mech-nav.t 2012-02-12 19:57:38.423630818 +0100
@@ -26,6 +26,8 @@
$mech->get($server->url);
+sleep 1;
+
$mech->click_button(number => 1);
like( $mech->uri, qr/formsubmit/, 'Clicking on button by number' );
my $last = $mech->uri;
--- t/51-click_button.t~ 2012-02-12 12:07:33.000000000 +0100
+++ t/51-click_button.t 2012-02-12 21:00:45.167679586 +0100
@@ -25,6 +25,7 @@
my $server = Test::HTTP::LocalServer->spawn();
$mech->get($server->url);
+sleep 1;
my @forms = $mech->forms;
my $form = $forms[0];
--- t/70-mech-png.t~ 2012-02-12 12:07:33.000000000 +0100
+++ t/70-mech-png.t 2012-02-12 21:01:15.651678533 +0100
@@ -41,7 +41,7 @@
is_deeply $got, $_[1], $_[2]
or diag Dumper $got;
} else {
- SKIP: skip "Image::Info not available", 1;
+ SKIP: { skip "Image::Info not available", 1; }
};
};
--- t/70-real-status.t~ 2012-02-12 12:07:33.000000000 +0100
+++ t/70-real-status.t 2012-02-12 22:23:40.866996031 +0100
@@ -33,6 +33,7 @@
t::helper::run_across_instances(\@instances, $instance_port, \&new_me
+ch, sub {
my ($instance, $mech) = @_;
$mech->get($server->url);
+ sleep 1;
my $response = $mech->response;
--- t/75-save_url-cookies.t~ 2012-02-12 12:07:33.000000000 +0100
+++ t/75-save_url-cookies.t 2012-02-13 00:30:03.986919932 +0100
@@ -45,7 +45,7 @@
$server->url->port,
undef,
undef,
- 5, # 5 seconds expiry
+ 120, # 2 minutes expiry
);
my $count;
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.