Improve reliability of stdout tests.

If the test runner is under heavy load, the command we are testing may
succeed in printing to stdout before the dummy receiver has terminated.
Add a short delay to reduce the likelihood of this happening.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47572
This commit is contained in:
Dag-Erling Smørgrav 2024-11-14 20:41:35 +01:00
parent 0b4539ee54
commit b697835ce6
3 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,7 @@ stdout_head() {
stdout_body() {
(
trap "" PIPE
sleep 1
echo " $a $b" | asa 2>stderr
echo $? >result
) | true

View File

@ -138,6 +138,7 @@ atf_check_stdout()
{
(
trap "" PIPE
sleep 1
cmp "$@" 2>stderr
echo $? >result
) | true

View File

@ -139,6 +139,7 @@ stdout_body()
{
(
trap "" PIPE
sleep 1
env 2>stderr
echo $? >result
) | true