civodul pushed a commit to branch main
in repository shepherd.
commit cf7057811dc764fb4d06cef746cf98eb7880aadf
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sun Mar 2 23:34:45 2025 +0100
tests: Fix race condition in ‘inetd.sh’.
* tests/inetd.sh: Wait until ‘test-inetd-1’ shows up.
---
tests/inetd.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tests/inetd.sh b/tests/inetd.sh
index c9e76f9..de388ee 100644
--- a/tests/inetd.sh
+++ b/tests/inetd.sh
@@ -1,5 +1,5 @@
# GNU Shepherd --- Test transient services.
-# Copyright © 2022-2024 Ludovic Courtès <[email protected]>
+# Copyright © 2022-2025 Ludovic Courtès <[email protected]>
#
# This file is part of the GNU Shepherd.
#
@@ -131,7 +131,10 @@ guile -c "
(connect sock address)
(sleep 300)" &
client_pid=$!
-$herd status test-inetd-1
+
+# Wait until the inetd service shows up.
+until $herd status test-inetd-1; do sleep 0.3; done
+
$herd status test-inetd-1 | grep transient
$herd status test-inetd-1 | grep "Command:.*$SHELL.*echo hello"
$herd stop test-inetd-1