tests: fix spurious failure due to missing sleeps
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 3 Jun 2013 09:27:49 +0000 (11:27 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 3 Jun 2013 09:27:49 +0000 (11:27 +0200)
Fixes automake bug#14528.

* THANKS: Give credit to that bug's original reporter.

* t/remake-configure-dependencies.sh: Add few missing '$sleep'
invocations.  I thought that the sleeps implicit in the configure
invocation were enough, but they were not, actually.  Here is what
can happen:

  1. The config.status script is generated by a configure run.
  2. ./config.status and make are run.
  3. The 'print-version' script is modified.
  4. Since that script is listed in $(CONFIGURE_DEPENDENCIES),
     autoconf is re-run.
  5. On a fast-enough machine, the three steps 2-4 above, even
     combined, might have taken less than a second to run;
  6. If the filesystem doesn't have a sub-second timestamp
     resolution, that means the newly-generated configure has
     the same timestamp of the old config.status;
  7. So, config.status is not re-run, and the Makefiles are
     not updated.
  8. Spurious failure!

So we really need more explicit sleeps.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
THANKS
t/remake-configure-dependencies.sh

diff --git a/THANKS b/THANKS
index dbcb1ab..c5c7c49 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -67,6 +67,7 @@ Christian Cornelssen            ccorn@cs.tu-berlin.de
 Christina Gratorp               christina.gratorp@gmail.com
 Claudio Fontana                 sick_soul@yahoo.it
 Clifford Wolf                   clifford@clifford.at
+Colin Watson                    cjwatson@ubuntu.com
 Dagobert Michelsen              dam@opencsw.org
 Daiki Ueno                      ueno@unixuser.org
 Dalibor Topic                   robilad@kaffe.org
index 2e5df88..d81d881 100644 (file)
@@ -61,6 +61,7 @@ $AUTOMAKE
 ./configure
 $MAKE test-1
 
+$sleep
 (echo '#!/bin/sh' && echo 'printf %s 2.1') > print-version
 using_gmake || $MAKE Makefile
 $MAKE test-2
@@ -70,6 +71,8 @@ mkdir build
 cd build
 ../configure
 $MAKE test-2
+
+$sleep
 (echo '#!/bin/sh' && echo 'printf %s 3.14') > ../print-version
 using_gmake || $MAKE Makefile
 $MAKE test-3