git: 0ff2b4a85b66 - stable/14 - Improve reliability of stdout tests.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 Dec 2024 12:39:41 UTC
The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0ff2b4a85b66d5fb8cf526a47c6367671bc2bc42 commit 0ff2b4a85b66d5fb8cf526a47c6367671bc2bc42 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2024-11-14 19:41:35 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2024-12-09 12:39:21 +0000 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) --- usr.bin/asa/tests/asa_test.sh | 1 + usr.bin/cmp/tests/cmp_test2.sh | 1 + usr.bin/env/tests/env_test.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/usr.bin/asa/tests/asa_test.sh b/usr.bin/asa/tests/asa_test.sh index 91515bb55d95..2b8fecb12d98 100644 --- a/usr.bin/asa/tests/asa_test.sh +++ b/usr.bin/asa/tests/asa_test.sh @@ -70,6 +70,7 @@ stdout_head() { stdout_body() { ( trap "" PIPE + sleep 1 echo " $a $b" | asa 2>stderr echo $? >result ) | true diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index 2ec6071851d3..bca8fc18a6b8 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -138,6 +138,7 @@ atf_check_stdout() { ( trap "" PIPE + sleep 1 cmp "$@" 2>stderr echo $? >result ) | true diff --git a/usr.bin/env/tests/env_test.sh b/usr.bin/env/tests/env_test.sh index 2dc8f1a4c911..3210361eb223 100644 --- a/usr.bin/env/tests/env_test.sh +++ b/usr.bin/env/tests/env_test.sh @@ -139,6 +139,7 @@ stdout_body() { ( trap "" PIPE + sleep 1 env 2>stderr echo $? >result ) | true