Subject: Re: bug#8365: 3 of 657 tests failed

From: Stefano Lattarini <[email-masked]>
Date: Wed, 30 Mar 2011 18:47:20 +0200

And the diagnosis for the failure of subdir5.test seems very similar.

(In fact, it would have been much simpler to start by analyzing this
failure, since it is a much simplified version of the aclocal6.test
failure; but shame on me, I just proceded in alphabetical order w.r.t.
the test names!)

What about the following squash-in for the previous patch?  It makes
more senso to fix two such similar failures at once, rather than in
two separate patches.  The resulting updated patch is attached.

Thanks, and sorry for the noise,
  Stefano

-*-*-

diff --git a/ChangeLog b/ChangeLog
index bafedb1..9519688 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
 2011-03-30  Stefano Lattarini  <[email-masked]>
 
-	tests: fix timestamp-related spurious failure in aclocal6.test
-	Related to automake bug#8365.
+	tests: fix two timestamp-related spurious failures
+	Fixes automake bug#8365.
 	* tests/aclocal6.test: Sleep before modifying m4 files that should
 	trigger remake rules.  This fixes an hard-to-hit timestamp-related
 	race condition.
+	* tests/subdir5.test: Likewise.
 	Report from Sam Steingold.
 
 2011-03-21  Ralf Wildenhues  <[email-masked]>
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 5633ac6..c4473d3 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -67,6 +67,8 @@ $MAKE
 # does it in the other way: it updates confiles.m4 (which is m4_included
 # by configure.in there) after Makefile.am.
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 sed <configure.in >configure.tmp -e '/^AC_OUTPUT$/i\
 AC_CONFIG_FILES([maude/Makefile])\
 m4_include([confile.m4])\
@@ -94,6 +96,8 @@ test -f maude/Makefile
 # Then we add a new directory by modifying a file included (through
 # `m4_include') by configure.in.
 mkdir maude2
+# Modified configure dependencies must be newer than config.status.
+$sleep
 cat >> confile.m4 << 'END'
 AC_CONFIG_FILES([maude2/Makefile])
 AC_SUBST([GREPME])
From bcb0022b0eb9cb5287e03e746f63c531af69b6f4 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <[email-masked]>
Date: Wed, 30 Mar 2011 18:06:29 +0200
Subject: [PATCH] tests: fix timestamp-related spurious failure in aclocal6.test

Related to automake bug#8365.

* tests/aclocal6.test: Sleep before modifying m4 files that should
trigger remake rules.  This fixes an hard-to-hit timestamp-related
race condition.
* tests/subdir5.test: Likewise.

Report from Sam Steingold.
---
 ChangeLog           |   10 ++++++++++
 tests/aclocal6.test |    4 +++-
 tests/subdir5.test  |    6 +++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dae2a48..9519688 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-03-30  Stefano Lattarini  <[email-masked]>
+
+	tests: fix two timestamp-related spurious failures
+	Fixes automake bug#8365.
+	* tests/aclocal6.test: Sleep before modifying m4 files that should
+	trigger remake rules.  This fixes an hard-to-hit timestamp-related
+	race condition.
+	* tests/subdir5.test: Likewise.
+	Report from Sam Steingold.
+
 2011-03-21  Ralf Wildenhues  <[email-masked]>
 
 	tests: fix unindent to use printf not echo for script.
diff --git a/tests/aclocal6.test b/tests/aclocal6.test
index ea6bac3..c8ae21b 100755
--- a/tests/aclocal6.test
+++ b/tests/aclocal6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -57,6 +57,8 @@ cd build
 ../configure
 $MAKE
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 # Update an aclocal.m4 dependency, then make sure all Makefiles
 # are updated, even from a sub-directory.
 echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 5633ac6..c4473d3 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -67,6 +67,8 @@ $MAKE
 # does it in the other way: it updates confiles.m4 (which is m4_included
 # by configure.in there) after Makefile.am.
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 sed <configure.in >configure.tmp -e '/^AC_OUTPUT$/i\
 AC_CONFIG_FILES([maude/Makefile])\
 m4_include([confile.m4])\
@@ -94,6 +96,8 @@ test -f maude/Makefile
 # Then we add a new directory by modifying a file included (through
 # `m4_include') by configure.in.
 mkdir maude2
+# Modified configure dependencies must be newer than config.status.
+$sleep
 cat >> confile.m4 << 'END'
 AC_CONFIG_FILES([maude2/Makefile])
 AC_SUBST([GREPME])
-- 
1.7.2.3