perl -x patchlevel.h "This is a custom patch"
+=head1 Disabling known flapping tests
+
+Some tests could fail under heavy load, whereas in most cases
+they would simply succeed. Usually, continuous integration systems
+will at one point or the other reach that problem.
+
+To disable these known tests, please set the environment
+variable CI to true.
+
+ CI=true
+
=cut
}
}
-use Test::More tests => 3;
+use Test::More tests => 4;
BEGIN { push @INC, '.' }
use t::Watchdog;
or print("# slept too long, $one $two $three\n");
SKIP: {
- skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday;
+ skip "no gettimeofday", 2 unless &Time::HiRes::d_gettimeofday;
my $f = Time::HiRes::time();
Time::HiRes::nanosleep(500_000_000);
my $f2 = Time::HiRes::time();
my $d = $f2 - $f;
- ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n");
+ cmp_ok $d, '>', 0.4, "nanosleep for more than 0.4 sec";
+ skip "flapping test - more than 0.9 sec could be necessary...", 1 if $ENV{CI};
+ cmp_ok $d, '<', 0.9 or diag("# slept $d secs $f to $f2\n");
}
1;