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

(cherry picked from commit b697835ce614de2fa30ba066983d7e71c48f34ce)
This commit is contained in:
Dag-Erling Smørgrav 2024-11-14 20:41:35 +01:00
parent d94ff663b6
commit 0ff2b4a85b
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