It turns out that, with NetBSD 5.1 make and FreeBSD 9 make, running
"make recheck" two times in a row quickly fails to correctly re-run
the failed tests in the second run.
That issue has been introduced likely introduced in commit
'
v1.12.1-95-gd5443e4' of 20102-07-01, "parallel-tests: reimplement
fix for bug#11791".
Anyway, the use case that has been broken is not realistic (who is
going to run "make recheck" two times in one second, without modifying
any of the tests or the tested programs in the meantime?), so we believe
the best fix is to simply work around the issue in the affected test
cases, rather than risking to slow down or uglify the 'recheck' rule.
* t/parallel-tests9.sh: Enhance a little.
* t/tap-recheck.sh: Adjust adding proper '$sleep' calls were required.
* t/parallel-tests-log-override-recheck.sh: Likewise.
* t/test-driver-custom-multitest-recheck.sh: Likewise.
* t/test-driver-custom-multitest-recheck2.sh: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
$FGREP bazbaz $x
done
+using_gmake || $sleep # Required by BSD make.
+
chmod a-rw my.log
BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log $MAKE -e recheck >stdout \
&& { cat stdout; exit 1; }
cat stdout
count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
-$MAKE recheck >stdout && { cat stdout; exit 1; }
-cat stdout
-count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1
-grep 'foo\.test' stdout && exit 1
-grep '^ERROR: bar\.test$' stdout
-grep '^FAIL: baz\.test$' stdout
+# Running this two times in a row should produce the same results the
+# second time.
+for i in 1 2; do
+ using_gmake || $sleep # Required by BSD make.
+ $MAKE recheck >stdout && { cat stdout; exit 1; }
+ cat stdout
+ count_test_results total=2 pass=0 fail=1 skip=0 xfail=0 xpass=0 error=1
+ grep 'foo\.test' stdout && exit 1
+ grep '^ERROR: bar\.test$' stdout
+ grep '^FAIL: baz\.test$' stdout
+done
# Ensure that recheck builds check_SCRIPTS, and that
# recheck reruns nothing if check has not been run.
count_test_results total=9 pass=3 fail=2 xpass=1 xfail=1 skip=1 error=1
: Let us make b.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo OK > b.ok
do_recheck --fail
# a.test has been successful the first time, so no need to re-run it.
count_test_results total=7 pass=2 fail=2 xpass=1 xfail=1 skip=1 error=0
: Let us make the first part of c.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo OK > c.pass
do_recheck --fail
test ! -e a.run
count_test_results total=5 pass=1 fail=1 xpass=1 xfail=1 skip=1 error=0
: Let us make also the second part of c.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo KO > c.xfail
do_recheck --fail
test ! -e a.run
: Nothing changed, so only d.test should be run.
for i in 1 2; do
+ using_gmake || $sleep # Required by BSD make.
do_recheck --fail
test ! -e a.run
test ! -e b.run
done
: Let us make d.test run more testcases, and experience _more_ failures.
+ using_gmake || $sleep # Required by BSD make.
echo 'test_count=9' > d.count
unindent > d.extra <<'END'
echo 'ok # SKIP s'
count_test_results total=11 pass=2 fail=4 xpass=1 xfail=0 skip=2 error=2
: Let us finally make d.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo 'test_count=1' > d.count
echo : > d.extra
do_recheck --pass
count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=0
: All tests have been successful or skipped, nothing should be re-run.
+ using_gmake || $sleep # Required by BSD make.
do_recheck --pass
test ! -e a.run
test ! -e b.run
$srcdir/configure
: A "make recheck" in a clean tree should run no tests.
+ using_gmake || $sleep # Required by BSD make.
do_recheck --pass
cat test-suite.log
test ! -e a.run
count_test_results total=9 pass=3 fail=2 xpass=1 xfail=1 skip=1 error=1
: Let us make b.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo OK > b.ok
do_recheck --fail
# a.test has been successful the first time, so no need to re-run it.
count_test_results total=7 pass=2 fail=2 xpass=1 xfail=1 skip=1 error=0
: Let us make the first part of c.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo OK > c.pass
do_recheck --fail
test ! -e a.run
count_test_results total=5 pass=1 fail=1 xpass=1 xfail=1 skip=1 error=0
: Let us make also the second part of c.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo KO > c.xfail
do_recheck --fail
test ! -e a.run
: Nothing changed, so only d.test should be run.
for i in 1 2; do
+ using_gmake || $sleep # Required by BSD make.
do_recheck --fail
test ! -e a.run
test ! -e b.run
done
: Let us make d.test run more testcases, and experience _more_ failures.
+ using_gmake || $sleep # Required by BSD make.
unindent > d.extra <<'END'
echo SKIP: s
echo FAIL: f 1
count_test_results total=11 pass=2 fail=4 xpass=1 xfail=0 skip=2 error=2
: Let us finally make d.test pass.
+ using_gmake || $sleep # Required by BSD make.
echo : > d.extra
do_recheck --pass
test ! -e a.run
count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=0
: All tests have been successful or skipped, nothing should be re-run.
+ using_gmake || $sleep # Required by BSD make.
do_recheck --pass
test ! -e a.run
test ! -e b.run
unset var
: a.test was successful the first time, no need to re-run it.
+ using_gmake || $sleep # Required by BSD make.
env TESTS=a.test $MAKE -e recheck >stdout \
|| { cat stdout; exit 1; }
cat stdout
test ! -e c.run
: b.test failed, it should be re-run. And make it pass this time.
+ using_gmake || $sleep # Required by BSD make.
echo OK > b.ok
TEST_LOGS=b.log $MAKE -e recheck >stdout \
|| { cat stdout; exit 1; }
rm -f *.run
: No need to re-run a.test or b.test anymore.
+ using_gmake || $sleep # Required by BSD make.
TEST_LOGS=b.log $MAKE -e recheck >stdout \
|| { cat stdout; exit 1; }
cat stdout
test ! -e a.run
test ! -e b.run
test ! -e c.run
+ using_gmake || $sleep # Required by BSD make.
TESTS='a.test b.test' $MAKE -e recheck >stdout \
|| { cat stdout; exit 1; }
cat stdout
: c.test contained and hard error the last time, so it should be re-run.
: This time, make it pass
# Use 'echo', not ':'; see comments above for why.
+ using_gmake || $sleep # Required by BSD make.
echo dummy > c.ok
env TESTS='c.test a.test' $MAKE -e recheck >stdout \
|| { cat stdout; exit 1; }
: Nothing should be rerun anymore, as all tests have been eventually
: successful.
+ using_gmake || $sleep # Required by BSD make.
$MAKE recheck >stdout || { cat stdout; exit 1; }
cat stdout
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0