From nobody Wed Jun 3 22:10:52 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gW22h1fH1z6gqnP for ; Wed, 03 Jun 2026 22:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gW22h0wbxz3WDW for ; Wed, 03 Jun 2026 22:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780524652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2MdnT/xaEYF48fwap1OKTwru/bOI+LN3UhgCO7Evzs=; b=VnV/l3e24+OWOMBUQ8GHDPql4shYhg2ynvAknVFp+GBIiw3yRsv8N5FZVS5vtgcpXI/JG4 tmkAg+zBXgflA/kVH06n2Qj2+plDVSJxialy8SaUBjGBaxrAP8Q1TTmlfr+0lfaoFtZAP3 TIGql7+XXjN38He5dAqC6nn8l3ANyh2F7MibtLEj4oLyX2ehu66LkSh6Ewxp94bQPJr2TY OvASYTCiDdJtGynCLhi5c6bJAQ+nf6idcvfkhZCw9Mmpxf3SRJN4EUKrdEOO+NXb9ojnMm CpP7aD9rjvR4zBWBAZcOCer+W8raLzlvnAQR8nP6WRfd0gms4epTKzkvMgaq3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780524652; a=rsa-sha256; cv=none; b=ZPJ7Yh9YhwfVQr0HhGVT5q5a5j93boIAGu5kb48aJijKigfwmx6DlpZyRTCsuv9EytQvnj Jtmo57gU2k7SKyYiywDjyiH2krK0zl3mHSeZu6zfbDJ0a2KeLm480zz/Bfn0Jhf6FKgF8K jUx0YjpB+K4CHpde/ZMSut7Be8gTRWdol7Gf+PeS4ASrcgCdV5gxOgp0i9UT1gnHPuklmu PtFrK4rOMmf6HbN3kOiH/BjkoJj/ea3h26S9KZCo4fQ7sOJydf0RpapkGrJeSI2Vy4w6NI GH+UlPRQoPL2UUJF/ee5+77XrWbZ5Dmkdfu56de4IAzblj9E0CpiSf2c5oIa4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780524652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2MdnT/xaEYF48fwap1OKTwru/bOI+LN3UhgCO7Evzs=; b=iDY7/ApuWr6b2DdTKZFQEGKvzEEhVBIcPQ3NEQWgUVOpQHjvqM3cEPjtZlUZeG9CKA6i0D Vj2P+JxC2gmpgiM98LIIQsTAsKvfYg4jBn+boFLp2O4uYKGp5/n8VIeumqNHsU5Mofdrkc f3mFGhKYlwROO5p/1lLiZ9+I4vWFHrRYKM2vSiow9EIBgT1Y6iSUuiZIdHX26/KSU5+Eks qhKN049zynlPmQcgYSPPm1N93twtH1PReWbmJ3UUi9ONGLVp0PX2yTCRChqrtIO5yJMkPA 3ferd9TX9r+VV4G3NqBstwr940v0U3kMYjFK/Aus/Sv/yYQl/mlr+aFs5gMV8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gW22h0VdYzTwL for ; Wed, 03 Jun 2026 22:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42d17 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Jun 2026 22:10:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jilles Tjoelker Subject: git: 73e0d6b44038 - main - tests: Avoid sleep when causing a write error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73e0d6b44038d1c7764c5013a54ae17a8f680a69 Auto-Submitted: auto-generated Date: Wed, 03 Jun 2026 22:10:52 +0000 Message-Id: <6a20a66c.42d17.6a25c515@gitrepo.freebsd.org> The branch main has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=73e0d6b44038d1c7764c5013a54ae17a8f680a69 commit 73e0d6b44038d1c7764c5013a54ae17a8f680a69 Author: Jilles Tjoelker AuthorDate: 2026-06-03 22:10:08 +0000 Commit: Jilles Tjoelker CommitDate: 2026-06-03 22:10:08 +0000 tests: Avoid sleep when causing a write error Cause a write error using a fifo and wait, rather than needing a sleep to wait for something to terminate. This is faster and avoids a potential test failure on a heavily loaded system. Using /dev/full would be simpler, but it is not portable enough (it tends not to be available in jails, even). Starting programs with stdout not open or only open for read/execute/search may have unexpected side effects. Reviewed by: ngie, des Differential Revision: https://reviews.freebsd.org/D57213 --- bin/pwd/tests/pwd_test.sh | 15 ++++++++------- usr.bin/asa/tests/asa_test.sh | 12 +++++++----- usr.bin/cmp/tests/cmp_test2.sh | 12 +++++++----- usr.bin/du/tests/du_test.sh | 12 +++++++----- usr.bin/env/tests/env_test.sh | 12 +++++++----- usr.bin/ident/tests/ident_test.sh | 12 +++++++----- usr.bin/printenv/tests/printenv_test.sh | 13 +++++++------ usr.bin/uniq/tests/uniq_test.sh | 13 +++++++------ usr.bin/yes/tests/yes_test.sh | 13 +++++++------ 9 files changed, 64 insertions(+), 50 deletions(-) diff --git a/bin/pwd/tests/pwd_test.sh b/bin/pwd/tests/pwd_test.sh index a8805582cc4d..db062b253a0d 100644 --- a/bin/pwd/tests/pwd_test.sh +++ b/bin/pwd/tests/pwd_test.sh @@ -75,14 +75,15 @@ stdout_body() { pwd=$(which pwd) [ -f "$pwd" ] || atf_skip "unable to distinguish binary from builtin" - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + "$pwd" 2>stderr + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/asa/tests/asa_test.sh b/usr.bin/asa/tests/asa_test.sh index 2b8fecb12d98..d6cb9f404318 100644 --- a/usr.bin/asa/tests/asa_test.sh +++ b/usr.bin/asa/tests/asa_test.sh @@ -68,13 +68,15 @@ stdout_head() { atf_set descr "Failure to write to stdout" } stdout_body() { - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index bca8fc18a6b8..b148e77b62b2 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -136,13 +136,15 @@ bflag_body() # Helper for stdout test case atf_check_stdout() { - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"2\n" cat result + result=$? + } >fifo + atf_check_equal 2 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 16accdcb42a1..5b298785c058 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -306,13 +306,15 @@ stdout_head() } stdout_body() { - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/env/tests/env_test.sh b/usr.bin/env/tests/env_test.sh index 3210361eb223..ed1d82f38281 100644 --- a/usr.bin/env/tests/env_test.sh +++ b/usr.bin/env/tests/env_test.sh @@ -137,13 +137,15 @@ stdout_head() } stdout_body() { - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/ident/tests/ident_test.sh b/usr.bin/ident/tests/ident_test.sh index 9dcc45a1625f..2fae2fe8d1e1 100755 --- a/usr.bin/ident/tests/ident_test.sh +++ b/usr.bin/ident/tests/ident_test.sh @@ -70,13 +70,15 @@ stdout_head() stdout_body() { local dir=$(atf_get_srcdir) - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/printenv/tests/printenv_test.sh b/usr.bin/printenv/tests/printenv_test.sh index 83535a555b17..8a9650819d82 100644 --- a/usr.bin/printenv/tests/printenv_test.sh +++ b/usr.bin/printenv/tests/printenv_test.sh @@ -78,14 +78,15 @@ stdout_head() } stdout_body() { - local dir=$(atf_get_srcdir) - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/uniq/tests/uniq_test.sh b/usr.bin/uniq/tests/uniq_test.sh index fc143632bdd2..46233640b5de 100755 --- a/usr.bin/uniq/tests/uniq_test.sh +++ b/usr.bin/uniq/tests/uniq_test.sh @@ -197,14 +197,15 @@ stdout_head() { atf_set descr "error writing to stdout" } stdout_body() { - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr } diff --git a/usr.bin/yes/tests/yes_test.sh b/usr.bin/yes/tests/yes_test.sh index 797ac5f6ac9f..5f2f4566d01a 100644 --- a/usr.bin/yes/tests/yes_test.sh +++ b/usr.bin/yes/tests/yes_test.sh @@ -66,14 +66,15 @@ stdout_head() } stdout_body() { - ( + mkfifo fifo + : stderr - echo $? >result - ) | true - atf_check -o inline:"1\n" cat result + result=$? + } >fifo + atf_check_equal 1 "$result" atf_check -o match:"stdout" cat stderr }