- make the watchdog time exceed the maximum time for the "very basic times
test". This doesn't prevent the test from failing, but prevents the
entire test script from being killed by the watchdog if the times()
test does fail
- do more work inside the loop, with the previous "burn cycles" loop
system time was increasing but user time stayed at its starting value.
# burning tons of CPU for dates far in the future.
# watchdog() makes sure that the test script eventually exits if
# the tests are triggering the failing behavior
-watchdog(15);
+watchdog(25);
($beguser,$begsys) = times;
while (($now = time) == $beg) { sleep 1 }
ok($now > $beg && $now - $beg < 10, 'very basic time test');
-
+my $x = "aaaa";
for ($i = 0; $i < 1_000_000; $i++) {
- for my $j (1..100) {}; # burn some user cycles
+ for my $j (1..1000) { ++$x; }; # burn some user cycles
($nowuser, $nowsys) = times;
$i = 2_000_000 if $nowuser > $beguser && ( $nowsys >= $begsys ||
(!$nowsys && !$begsys));