Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2026 19:17:08 +0000
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: be9f35396449 - main - Revert "sh/tests: Cut down builtins/read12.0 by 2 seconds"
Message-ID:  <6a14a034.4547b.382fad18@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jilles:

URL: https://cgit.FreeBSD.org/src/commit/?id=be9f35396449129ebe952fdd1c080f7856dee030

commit be9f35396449129ebe952fdd1c080f7856dee030
Author:     Jilles Tjoelker <jilles@FreeBSD.org>
AuthorDate: 2026-05-25 19:15:51 +0000
Commit:     Jilles Tjoelker <jilles@FreeBSD.org>
CommitDate: 2026-05-25 19:16:52 +0000

    Revert "sh/tests: Cut down builtins/read12.0 by 2 seconds"
    
    Dag-Erling Smørgrav does not like this, but I do not understand why.
    
    This reverts commit 1df431576f99c3cc26dd4ceb1a6eda864cc9f196.
---
 bin/sh/tests/builtins/read11.0 |  3 +--
 bin/sh/tests/builtins/read12.0 | 14 ++++++--------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/bin/sh/tests/builtins/read11.0 b/bin/sh/tests/builtins/read11.0
index e57dfdbc0ea4..07bd3e70644c 100644
--- a/bin/sh/tests/builtins/read11.0
+++ b/bin/sh/tests/builtins/read11.0
@@ -27,7 +27,6 @@ ts=$(date +%s%3N)
 read -t 0 v <&3 || r=$?
 te=$(date +%s%3N)
 kill -TERM "$!" || :
-[ "$r" -gt 128 ]
-[ "$(kill -l "$r")" = ALRM ]
+[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = ALRM ]
 [ $((te-ts)) -lt 250 ]
 [ -z "$v" ]
diff --git a/bin/sh/tests/builtins/read12.0 b/bin/sh/tests/builtins/read12.0
index 3b501a56392b..4551555adfed 100644
--- a/bin/sh/tests/builtins/read12.0
+++ b/bin/sh/tests/builtins/read12.0
@@ -1,5 +1,5 @@
-# Verify that `read -t 1 v` succeeds immediately if input is available
-# and times out after 1 s if not
+# Verify that `read -t 3 v` succeeds immediately if input is available
+# and times out after 3 s if not
 
 set -e
 
@@ -15,7 +15,7 @@ exec 3<fifo1
 v=original_value
 r=0
 ts=$(date +%s%3N)
-read -t 1 v <&3 || r=$?
+read -t 3 v <&3 || r=$?
 te=$(date +%s%3N)
 [ "$r" -eq 0 ]
 [ $((te-ts)) -lt 250 ]
@@ -24,11 +24,9 @@ te=$(date +%s%3N)
 v=original_value
 r=0
 ts=$(date +%s%3N)
-read -t 1 v <&3 || r=$?
+read -t 3 v <&3 || r=$?
 te=$(date +%s%3N)
 kill -TERM "$!" || :
-[ "$r" -gt 128 ]
-[ "$(kill -l "$r")" = ALRM ]
-[ $((te-ts)) -ge 1000 ]
-[ $((te-ts)) -lt 1250 ]
+[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = ALRM ]
+[ $((te-ts)) -gt 3000 ] && [ $((te-ts)) -lt 3250 ]
 [ -z "$v" ]


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a14a034.4547b.382fad18>