New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not OK: perl 5.10.0 +RC1 on ia64-linux 2.4.21-sgi302r24 (UNINSTALLED) #9129
Comments
From jpl@research.att.comFailed two tests: I scraped them off the screen... t/op/stat.....................................................# Failed at op/stat.t line 466 lib/CPANPLUS/t/03_CPANPLUS-Internals-Source...................# Failed test ' Timestamp on sourcefile updated' My home directory is NFS mounted on this host, I suspect that may Perl Info
|
From @doughera88On Fri, 23 Nov 2007, jpl @ research . att . com wrote:
Yes, that is likely. If the clocks on the host and NFS server are out of -- |
The RT System itself - Status changed from 'new' to 'open' |
From @schwernAndy Dougherty wrote:
I'm surprised more didn't fail. MakeMaker deals with this by touching a file then checking what its mtime is. See calibrate_mtime() in t/lib/MakeMaker/Test/Utils.pm. For the CPANPLUS test it's a simple matter of replacing "time" with Patch in the works. -- |
From @schwernMichael G Schwern wrote:
Attached is the threatened patch. Could you please try it out on your nfs -- |
From @schwernnfs.patch--- lib/CPANPLUS/t/03_CPANPLUS-Internals-Source.t (revision 40900)
+++ lib/CPANPLUS/t/03_CPANPLUS-Internals-Source.t (local)
@@ -25,6 +25,18 @@
my $at = $cb->_author_tree;
my $modname = TEST_CONF_MODULE;
+# To account for network filesystem time offsets
+sub filesystem_time {
+ ok open TMP, ">file.tmp";
+ print TMP "foo\n";
+ close TMP;
+
+ my $time = [stat("file.tmp")]->[9];
+ 1 while unlink 'file.tmp';
+
+ return $time;
+}
+
for my $name (qw[auth mod dslip] ) {
my $file = File::Spec->catfile(
$conf->get_conf('base'),
@@ -146,7 +158,7 @@
can_ok( $cb, $meth );
### mark what time it is now, sleep 1 second for better measuring
- my $now = time;
+ my $now = filesystem_time;
sleep 1;
my $ok = $cb->$meth;
@@ -162,7 +174,7 @@
can_ok( $cb, $meth );
### mark what time it is now, sleep 1 second for better measuring
- my $now = time;
+ my $now = filesystem_time;
sleep 1;
my $ok = $cb->$meth( remote => $uri );
@@ -177,7 +189,7 @@
{ CPANPLUS::Error->flush;
### mark what time it is now, sleep 1 second for better measuring
- my $now = time;
+ my $now = filesystem_time;
sleep 1;
my $ok = $cb->_build_trees(
--- t/op/stat.t (revision 40900)
+++ t/op/stat.t (local)
@@ -50,6 +50,10 @@
my($nlink, $mtime, $ctime) = (stat(FOO))[$NLINK, $MTIME, $CTIME];
+# The clock on a network filesystem might be different from the
+# system clock.
+my $Filesystem_Time_Offset = $mtime - time;
+
#nlink should if link support configured in Perl.
SKIP: {
skip "No link count - Hard link support not built in.", 1
@@ -463,9 +467,9 @@
print "# time=$^T, stat=(@a)\n";
my @b = (-M _, -A _, -C _);
print "# -MAC=(@b)\n";
-ok( (-M _) < 0, 'negative -M works');
-ok( (-A _) < 0, 'negative -A works');
-ok( (-C _) < 0, 'negative -C works');
+cmp_ok( -M _, '<', $Filesystem_Time_Offset, 'negative -M works');
+cmp_ok( -A _, '<', $Filesystem_Time_Offset, 'negative -A works');
+cmp_ok( -C _, '<', $Filesystem_Time_Offset, 'negative -C works');
ok(unlink($f), 'unlink tmp file');
{
|
From @doughera88On Mon, 26 Nov 2007, Michael G Schwern wrote:
Ah, clever. Yes, for CPANPLUS, that's probably very sensible. For the -- |
From @schwernAndy Dougherty wrote:
Yes, it's difficult to tell the difference between a broken stat returning the Boy, wouldn't it be nice if time offset synchronization was built into the NFS More pragmatically, the way that I patched it, still using the < operator, -- |
From ben@morrow.me.ukQuoth schwern@pobox.com (Michael G Schwern):
Since this is supposed to be testing -M can be negative, should it Ben |
From @rgsOn 27/11/2007, Andy Dougherty <doughera@lafayette.edu> wrote:
Jos will handle the CPANPLUS patch. For the stat.t failure, I choose to |
From @doughera88On Tue, 27 Nov 2007, Ben Morrow wrote:
[t/op/stat.t issues with unsynchronized NFS clocks]
Yes, and that could be a problem. This year, the U.S. changed daylight -- |
From jpl@research.att.comQuoth schwern@pobox.com (Michael G Schwern):
I tried a varient of Schwern's patch, using open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!"); my($nlink, $mtime, $ctime) = (stat(FOO))[$NLINK, $MTIME, $CTIME]; # The clock on a network filesystem might be different from the
to ensure the offset wasn't negative, and was in units comparable |
From jpl@research.att.comIn the spirit of trying to be helpful, how about this, as a ... -- jpl Inline Patch--- stat.t.orig Sun Jul 29 14:15:44 2007
+++ stat.t Tue Nov 27 13:41:23 2007
@@ -50,6 +50,10 @@
my($nlink, $mtime, $ctime) = (stat(FOO))[$NLINK, $MTIME, $CTIME];
+# The clock on a network filesystem might be different from the
+# system clock.
+my $Filesystem_Time_Offset = abs($mtime - time);
+
#nlink should if link support configured in Perl.
SKIP: {
skip "No link count - Hard link support not built in.", 1
@@ -453,20 +457,24 @@
unlink $linkname or print "# unlink $linkname failed: $!\n";
}
-print "# Zzz...\n";
-sleep(3);
-my $f = 'tstamp.tmp';
-unlink $f;
-ok (open(S, "> $f"), 'can create tmp file');
-close S or die;
-my @a = stat $f;
-print "# time=$^T, stat=(@a)\n";
-my @b = (-M _, -A _, -C _);
-print "# -MAC=(@b)\n";
-ok( (-M _) < 0, 'negative -M works');
-ok( (-A _) < 0, 'negative -A works');
-ok( (-C _) < 0, 'negative -C works');
-ok(unlink($f), 'unlink tmp file');
+SKIP: {
+ skip "Too much clock skew between system and filesystem", 5
+ if ($Filesystem_Time_Offset > 5);
+ print "# Zzz...\n";
+ sleep($Filesystem_Time_Offset+1);
+ my $f = 'tstamp.tmp';
+ unlink $f;
+ ok (open(S, "> $f"), 'can create tmp file');
+ close S or die;
+ my @a = stat $f;
+ print "# time=$^T, stat=(@a)\n";
+ my @b = (-M _, -A _, -C _);
+ print "# -MAC=(@b)\n";
+ ok( (-M _) < 0, 'negative -M works');
+ ok( (-A _) < 0, 'negative -M works');
+ ok( (-C _) < 0, 'negative -M works');
+ ok(unlink($f), 'unlink tmp file');
+}
{
ok(open(F, ">", $tmpfile), 'can create temp file'); |
From jpl@research.att.comArggh. Cut-and-paste excess. Sorry! Inline Patch--- stat.t.orig Sun Jul 29 14:15:44 2007
+++ stat.t Tue Nov 27 13:48:32 2007
@@ -50,6 +50,10 @@
my($nlink, $mtime, $ctime) = (stat(FOO))[$NLINK, $MTIME, $CTIME];
+# The clock on a network filesystem might be different from the
+# system clock.
+my $Filesystem_Time_Offset = abs($mtime - time);
+
#nlink should if link support configured in Perl.
SKIP: {
skip "No link count - Hard link support not built in.", 1
@@ -453,20 +457,24 @@
unlink $linkname or print "# unlink $linkname failed: $!\n";
}
-print "# Zzz...\n";
-sleep(3);
-my $f = 'tstamp.tmp';
-unlink $f;
-ok (open(S, "> $f"), 'can create tmp file');
-close S or die;
-my @a = stat $f;
-print "# time=$^T, stat=(@a)\n";
-my @b = (-M _, -A _, -C _);
-print "# -MAC=(@b)\n";
-ok( (-M _) < 0, 'negative -M works');
-ok( (-A _) < 0, 'negative -A works');
-ok( (-C _) < 0, 'negative -C works');
-ok(unlink($f), 'unlink tmp file');
+SKIP: {
+ skip "Too much clock skew between system and filesystem", 5
+ if ($Filesystem_Time_Offset > 5);
+ print "# Zzz...\n";
+ sleep($Filesystem_Time_Offset+1);
+ my $f = 'tstamp.tmp';
+ unlink $f;
+ ok (open(S, "> $f"), 'can create tmp file');
+ close S or die;
+ my @a = stat $f;
+ print "# time=$^T, stat=(@a)\n";
+ my @b = (-M _, -A _, -C _);
+ print "# -MAC=(@b)\n";
+ ok( (-M _) < 0, 'negative -M works');
+ ok( (-A _) < 0, 'negative -A works');
+ ok( (-C _) < 0, 'negative -C works');
+ ok(unlink($f), 'unlink tmp file');
+}
{
ok(open(F, ">", $tmpfile), 'can create temp file'); |
From @schwernRafael Garcia-Suarez wrote:
Since we can detect the problem in the test, how about just skipping the -- |
From @schwernJohn P. Linderman wrote:
+1 -- |
From @rgs2007/11/27 John P. Linderman <jpl@research.att.com>:
Thanks, applied as #34056. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#47746 (status was 'resolved')
Searchable as RT47746$
The text was updated successfully, but these errors were encountered: