Commit d288a387 authored by Matthieu Muffato's avatar Matthieu Muffato Committed by ens-bwalts
Browse files

Simplified the Runnable: no need to check for the overhead, checking that it...

Simplified the Runnable: no need to check for the overhead, checking that it slept 10 seconds suffices
parent 32ae5e59
......@@ -24,24 +24,13 @@ use Time::HiRes qw(time);
use Bio::EnsEMBL::Hive::Utils::Test qw(standaloneJob);
my $min_overhead;
for (1..10) {
my $t = time();
standaloneJob('Bio::EnsEMBL::Hive::RunnableDB::Dummy', {
'take_time' => 0,
});
my $d = time() - $t;
$min_overhead = $d if (not defined $min_overhead) || ($d < $min_overhead);
}
my $wait = 10;
my $t = time();
standaloneJob('Bio::EnsEMBL::Hive::RunnableDB::Dummy', {
'take_time' => $wait,
});
my $d = time() - $t;
# We allow the runnable to be 5 times faster than the fastest attempt so far
cmp_ok($d, '>=', $wait+$min_overhead/5, 'The "take_time" parameter made the runnable sleep a bit');
cmp_ok($d, '>=', $wait, 'The "take_time" parameter made the runnable sleep');
done_testing();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment