Subject: | with_mocktime mode broken for multiple sleep() |
Below script would output with t1 == t2. So only the first sleep() can cause the mocked time() to be advanced into future. Later calls to sleep() have no effect on time()
#!/usr/bin/env perl
use strict;
use warnings;
use Test::MockTime;
use Test::MockSleep qw(:with_mocktime);
my $begin = time();
sleep(10);
my $t1 = time();
sleep(10);
my $t2 = time();
print $begin, "\n";
print $t1, "\n";
print $t2, "\n";