]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: avoid spurious failure in 'parallel-tests3.test'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 18 Oct 2011 19:05:24 +0000 (21:05 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 18 Oct 2011 21:31:05 +0000 (23:31 +0200)
This fixes automake bug#8788.

* tests/parallel-tests3.test: To ensure that the serial run of
the dummy testsuite is still ongoing when the parallel run has
terminated, use `kill -0', not a bare `kill'.  This will prevent
a testsuite crash on NetBSD 5.1, and a testsuite hang on FreeBSD
8.2.  Also, since we are at it, try harder to avoid possible
hangs of the script in other unusual situations.

ChangeLog
tests/parallel-tests3.test

index a2ecefcae9dfd560e951229375f2a93c6bc00508..9ed30f080331185296671af3e023816766cc1b20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-10-18  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: avoid spurious failure in 'parallel-tests3.test'
+       This fixes automake bug#8788.
+       * tests/parallel-tests3.test: To ensure that the serial run of
+       the dummy testsuite is still ongoing when the parallel run has
+       terminated, use `kill -0', not a bare `kill'.  This will prevent
+       a testsuite crash on NetBSD 5.1, and a testsuite hang on FreeBSD
+       8.2.  Also, since we are at it, try harder to avoid possible
+       hangs of the script in other unusual situations.
+
 2011-10-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tests: fix spurious failure with autoconf 2.62
index a138f908a781fc424e21d166bfef40cf45c3138e..69ba1d07ea6cab8c07bcbbafcc855293d8cdaf28 100755 (executable)
@@ -70,15 +70,22 @@ $sleep
 : >stdout
 $MAKE -j4 check >> stdout
 cd ..
-kill $!
+# Ensure the tests are really being run in parallel mode: if this is
+# the case, the serial run of the dummy testsuite started above should
+# still be ongoing when the parallel one has terminated.
+kill -0 $!
 cat parallel/stdout
 test `grep -c PASS parallel/stdout` -eq 8
 
-# Wait long enough so that there are no open files any more
-# when the post-test cleanup runs.
-while test ! -f serial/test-suite.log
-do
-  $sleep
+# Wait long enough so that there are no open files any more when the
+# post-test cleanup runs.  But exit after we've waited for two minutes
+# or more, to avoid testsuite hangs in unusual situations (this has
+# already happened).
+i=1
+while test ! -f serial/test-suite.log && test $i -le 120; do
+  i=`expr $i + 1`
+  sleep '1' # Extra quoting to please maintainer-check.
 done
 $sleep
+
 :