develooper Front page | perl.perl5.porters | Postings from July 2011

Re: eu_command.t (was Re: Smoke [blead] v5.15.0-163-g17d5d82 FAIL(FM)MSWin32 Win2000 SP4 (x86/1 cpu))

Thread Previous | Thread Next
From:
George Greer
Date:
July 4, 2011 11:34
Subject:
Re: eu_command.t (was Re: Smoke [blead] v5.15.0-163-g17d5d82 FAIL(FM)MSWin32 Win2000 SP4 (x86/1 cpu))
Message ID:
alpine.LFD.2.02.1107041404510.14763@ein.m-l.org
On Mon, 4 Jul 2011, Nicholas Clark wrote:

> On Sun, Jul 03, 2011 at 03:18:00PM -0400, George Greer wrote:
>> Smoke logs available at http://m-l.org/~perl/smoke/perl/
>>
>> Automated smoke report for 5.15.0 patch 17d5d82df211d3a348c01e0ec2d38816bf89823a v5.15.0-163-g17d5d82
>> perl-win2k: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz(~2673 MHz) (x86/1 cpu)
>>     on        MSWin32 - Win2000 SP4
>>     using     cl version 14.00.50727.762
>>     smoketime 2 hours 26 minutes (average 36 minutes 41 seconds)
>
>> [default] -Duseithreads
>> ../cpan/Memoize/t/expmod_t.t................................FAILED
>>     10, 14
>> ../dist/ExtUtils-Command/t/eu_command.t.....................FAILED
>>     8
>>     Non-zero exit status: 1
>
> ../dist/ExtUtils-Command/t/cp.t ................................... ok
>
> #   Failed test 'newer file created'
> #   at t/eu_command.t line 78.
> #     '1'
> #         >=
> #     '2'
> # Looks like you failed 1 test of 40.
>
> The test code in question is:
>
>    my ($now) = time;
>    utime ($now, $now, $ARGV[0]);
>    sleep 2;
>
>    # Just checking modify time stamp, access time stamp is set
>    # to the beginning of the day in Win95.
>    # There's a small chance of a 1 second flutter here.
>    my $stamp = (stat($ARGV[0]))[9];
>    cmp_ok( abs($now - $stamp), '<=', 1, 'checking modify time stamp' ) ||
>      diag "mtime == $stamp, should be $now";
>
>    @ARGV = qw(newfile);
>    touch();
>
>    my $new_stamp = (stat('newfile'))[9];
>    cmp_ok( abs($new_stamp - $stamp), '>=', 2,  'newer file created' );
>
> perlfunc.pod notes:
>
>    On some older systems, it may sleep up to a full second less than what
>    you requested, depending on how it counts seconds.
>
>
> Given that Windows NT development started before Linux development, does that
> mean that it's one of these "older systems"? :-)
>
> But, whether it is or not, does that mean that the test's assumptions are
> unwise, that C<sleep 2> is enough to make a new file not less than 2 seconds
> newer?


I know at least "Sleep()" on Windows can return early but I don't know 
whether the same timer issues afflict "MsgWaitForMultipleObjects()" that 
Perl uses to sleep.

 	http://msdn.microsoft.com/en-us/library/ms686298%28VS.85%29.aspx
 	http://msdn.microsoft.com/en-us/library/ms684242%28v=VS.85%29.aspx

I'm using NTFS on my smoker so the 2-second file time resolution of FAT 
filesystem shouldn't be in play here.

My Linux host for the virtual machine accepted the TSC timer as 
synchronized across the processor cores so the virtual machine being 
handed off to another processor shouldn't cause any time-warp like this.

Makes me wish the test logged more information about the file metadata and 
the timestamps it pulled from time().

-- 
George Greer

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About