Garrett,
Thanks for doing the analysis of the test failure, and jumping on fixing it!
I appreciate all the work that you do in monitoring the tests and fixing
them.
In order for FreeBSD testing to work, we need more people like you to keep
an eye on things and help fix things. This stuff doesn't get done by
itself.
You have been pushing ATF and testing in FreeBSD for a number of years now.
Definitely much longer than I have been involved with this stuff.
Often, it seems like monitoring tests, analyzing the cause of test failures,
and fixing the problems are thankless tasks. Let me make it less
thankless
by saying Thank You!! :)
--
Craig
On Wed, May 20, 2015 at 8:26 PM, Garrett Cooper n...@freebsd.org wrote:
Author: ngie
Date: Thu May 21 03:26:46 2015
New Revision: 283166
URL: https://svnweb.freebsd.org/changeset/base/283166
Log:
Import proposed fix from
https://github.com/jmmv/atf/commit/0e546407567ea858e261e72f75c5ed61e07d0ddf.patch
PR: 197060
Original commit message:
From 0e546407567ea858e261e72f75c5ed61e07d0ddf Mon Sep 17 00:00:00 2001
From: Julio Merino j...@google.com
Date: Tue, 17 Feb 2015 18:10:11 -0500
Subject: [PATCH] Fix atf-sh/atf_check_test:flush_stdout_on_death
The test atf-sh/atf_check_test:flush_stdout_on_timeout was flaky as it
was playing solely with time. Fix this by making the test more robust
and rename it while we are at it: there is nothing left about timeouts
in this test, considering that ATF itself does not enforce deadlines
any longer.
Fixes FreeBSD PR 197060.
Modified:
vendor/atf/dist/atf-sh/atf_check_test.sh
vendor/atf/dist/atf-sh/misc_helpers.sh
Modified: vendor/atf/dist/atf-sh/atf_check_test.sh
==
--- vendor/atf/dist/atf-sh/atf_check_test.shThu May 21 01:50:06 2015
(r283165)
+++ vendor/atf/dist/atf-sh/atf_check_test.shThu May 21 03:26:46 2015
(r283166)
@@ -164,18 +164,22 @@ equal_body()
grep '^failed: \${x} != \${y} (a != b)$' resfile
}
-atf_test_case flush_stdout_on_timeout
-flush_stdout_on_timeout_body()
+atf_test_case flush_stdout_on_death
+flush_stdout_on_death_body()
{
-$(atf_get_srcdir)/misc_helpers -s $(atf_get_srcdir)
atf_check_timeout \
-out 2err
+CONTROL_FILE=$(pwd)/done $(atf_get_srcdir)/misc_helpers \
+-s $(atf_get_srcdir) atf_check_flush_stdout out 2err
pid=${!}
-sleep 1
-kill ${pid}
+while [ ! -f ./done ]; do
+echo Still waiting for helper to create control file
+ls
+sleep 1
+done
+kill -9 ${pid}
grep 'Executing command.*true' out \
|| atf_fail 'First command not in output'
-grep 'Executing command.*sleep 42' out \
+grep 'Executing command.*false' out \
|| atf_fail 'Second command not in output'
}
@@ -187,7 +191,7 @@ atf_init_test_cases()
atf_add_test_case null_stdout
atf_add_test_case null_stderr
atf_add_test_case equal
-atf_add_test_case flush_stdout_on_timeout
+atf_add_test_case flush_stdout_on_death
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
Modified: vendor/atf/dist/atf-sh/misc_helpers.sh
==
--- vendor/atf/dist/atf-sh/misc_helpers.sh Thu May 21 01:50:06 2015
(r283165)
+++ vendor/atf/dist/atf-sh/misc_helpers.sh Thu May 21 03:26:46 2015
(r283166)
@@ -139,16 +139,20 @@ atf_check_equal_eval_fail_body()
atf_check_equal '${x}' '${y}'
}
-atf_test_case atf_check_timeout
-atf_check_timeout_head()
+atf_test_case atf_check_flush_stdout
+atf_check_flush_stdout_head()
{
atf_set descr Helper test case for the t_atf_check test program
-atf_set timeout 1
+atf_set timeout 30
}
-atf_check_timeout_body()
+atf_check_flush_stdout_body()
{
atf_check true
-atf_check sleep 42
+atf_check -s exit:1 false
+touch ${CONTROL_FILE:-done}
+while :; do
+sleep 1
+done
}
#
-
@@ -281,7 +285,7 @@ atf_init_test_cases()
atf_add_test_case atf_check_equal_fail
atf_add_test_case atf_check_equal_eval_ok
atf_add_test_case atf_check_equal_eval_fail
-atf_add_test_case atf_check_timeout
+atf_add_test_case atf_check_flush_stdout
# Add helper tests for t_config.
atf_add_test_case config_get
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org