Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jul 2024 00:55:38 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a8a1633e34f1 - stable/14 - lockf tests: Fix a race
Message-ID:  <202407220055.46M0tc12007319@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by markj:

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

commit a8a1633e34f1961f724c5ede96cdb435702b194d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-07-14 16:13:13 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-07-22 00:55:27 +0000

    lockf tests: Fix a race
    
    The test launches lockf(1) in the background and races with it, so it
    shouldn't be using atf_check to check that lockf won the race.
    
    MFC after:      1 week
    
    (cherry picked from commit 498b3b494b8b3e500e555a9653d950b9e25a2f1a)
---
 usr.bin/lockf/tests/lockf_test.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh
index cc6938d2306e..d73c7590653d 100644
--- a/usr.bin/lockf/tests/lockf_test.sh
+++ b/usr.bin/lockf/tests/lockf_test.sh
@@ -47,7 +47,9 @@ basic_body()
 	lpid=$!
 
 	# Make sure that the lock exists...
-	atf_check test -e "testlock"
+	while ! test -e "testlock"; do
+		sleep 0.1
+	done
 
 	# Attempt both verbose and silent re-lock
 	atf_check -s exit:${EX_TEMPFAIL} -e not-empty \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407220055.46M0tc12007319>