automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intermittent test failures


From: Ralf Wildenhues
Subject: Re: Intermittent test failures
Date: Sat, 14 Aug 2010 11:29:33 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Hello again,

* Ralf Wildenhues wrote on Sat, Jul 31, 2010 at 02:11:59PM CEST:
> * Ludovic Courtès wrote on Tue, Jul 27, 2010 at 11:08:39AM CEST:
> > FYI the Automake test suite currently fails on Hydra.  The build at
> > http://hydra.nixos.org/build/502179 has 5 failures; the one at
> > http://hydra.nixos.org/build/502171 has 2 failures, etc.
> 
> thanks again for the report.  Can you please check with the system
> administrator to find out whether the system has 1s granularity on time
> stamps or higher?
>   ls -l --full-time
> 
> in some directory on the same partition should hopefully answer that,
> if coreutils is not borked.
> 
> And if better, we need to find out whether perl supports subsecond
> granularity and if that is true, whether Automake may have a bug in
> not getting/using that information correctly.
> 
> If the file system granularity is 1s, then, the next steps are either:
> 
> - making sure between start of configure and start of config.status at
>   least 1s has passed (i.e., either reinstate the sleep in the sanity
>   test or start a background sleep and check that before starting
>   config.status)

I now have a patch for the issue introduced in Automake git master with
<http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3643/>
where the sanity check was changed to not sleep for a second by default
any more.

The patch is below.  It would be nice if you could test it and report
back.  Or, if you prefer, I can apply and we see how build daemons
react.

There might still be a better solution to this issue without sleeping
at all in more cases; I'm not totally convinced the time stamp handling
in autotools is bugfree.  Also, we could still exploit nonportable means
to find out whether configure is more than a second old.  OTOH some of
the test failures were due to other autotools-generated files being just
created, so we'd have to somehow optimistically test for them, too ...

AFAICS this is the only regression in git master Automake over 1.11.1,
so with this fixed, master should be in releasable state again (modulo
other features we'd like to see in 1.12, of course).  :-)

Cheers,
Ralf

    Fix timestamp issues by ensuring configure takes at least a second.
    
    * m4/sanity.m4 (AM_SANITY_CHECK): If we didn't sleep here,
    start a sleep in the background and wait for it to finish
    before creating config.status, hopefully fixing all spurious
    testsuite failures involving botched time stamps.
    * NEWS: Update.
    Reports by Ludovic Courtès, Peter Breitenlohner, and others.

diff --git a/NEWS b/NEWS
index 19e4548..0032c75 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,12 @@ New in 1.11a:
   - The `compile' script now converts some options for MSVC for a better
     user experience.
 
+  - Automake's early configure-time sanity check now tries to avoid sleeping
+    for a second, which slowed down cached configure runs noticeably.  In that
+    case, it will check back at the end of the configure script to ensure that
+    at least one second has passed, to avoid time stamp issues with makefile
+    rules rerunning autotools programs.
+
 Bugs fixed in 1.11a:
 
   - Lots of minor bugfixes.
diff --git a/m4/sanity.m4 b/m4/sanity.m4
index db87c8b..94e1e51 100644
--- a/m4/sanity.m4
+++ b/m4/sanity.m4
@@ -1,13 +1,13 @@
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008, 2009
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008, 2009, 2010
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
+# serial 7
 
 # AM_SANITY_CHECK
 # ---------------
@@ -32,14 +32,14 @@ esac
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
+   am_has_slept=no
    for am_try in 1 2; do
-     echo timestamp > conftest.file
+     echo "timestamp, slept: $am_has_slept" > conftest.file
      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
      if test "$[*]" = "X"; then
        # -L didn't work.
        set X `ls -t "$srcdir/configure" conftest.file`
      fi
-     rm -f conftest.file
      if test "$[*]" != "X $srcdir/configure conftest.file" \
        && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
@@ -55,6 +55,7 @@ if (
      fi
      # Just in case.
      sleep 1
+     am_has_slept=yes
    done
    test "$[2]" = conftest.file
    )
@@ -65,4 +66,19 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT(yes)
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+  AC_CONFIG_COMMANDS_PRE(
+    [if test -n "$am_sleep_pid"; then
+       AC_MSG_CHECKING([that generated files are newer than configure])
+       wait $am_sleep_pid
+       AC_MSG_RESULT([done])
+     fi])
+fi
+rm -f conftest.file
+])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]