guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] branch master updated: tests: Remove racy check after "herd s


From: Ludovic Courtès
Subject: [shepherd] branch master updated: tests: Remove racy check after "herd stop root".
Date: Sat, 06 May 2023 13:55:30 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository shepherd.

The following commit(s) were added to refs/heads/master by this push:
     new 7c79df1  tests: Remove racy check after "herd stop root".
7c79df1 is described below

commit 7c79df11c7a9d938ed9b48e00c4366da95301d4b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat May 6 19:51:58 2023 +0200

    tests: Remove racy check after "herd stop root".
    
    Reported by Efraim Flashner <efraim@flashner.co.il>
    in <https://issues.guix.gnu.org/63178>.
    
    * tests/basic.sh: After "herd stop root", wait for a few more seconds if
    "kill -0 $shepherd_pid" succeeds.
    * tests/starting-status.sh: Remove racy "kill -0 $shepherd_pid" after
    "herd stop root".
    * tests/status-sexp.sh: Likewise.
    * tests/stopping-status.sh: Likewise.
---
 tests/basic.sh           | 17 +++++++++++++----
 tests/starting-status.sh |  1 -
 tests/status-sexp.sh     |  1 -
 tests/stopping-status.sh |  4 +---
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/tests/basic.sh b/tests/basic.sh
index 94bda5d..41f9b2c 100644
--- a/tests/basic.sh
+++ b/tests/basic.sh
@@ -279,7 +279,13 @@ $herd start root | grep "already running"
 grep "already running" "$log"
 
 $herd stop root
-kill -0 $shepherd_pid && false
+
+# The shepherd process should be done now, or real soon.
+if kill -0 $shepherd_pid
+then
+    sleep 3
+    kill -0 $shepherd_pid && false
+fi
 
 test -f "$log"
 
@@ -312,7 +318,10 @@ test -f "$stamp" && false
 shepherd_pid="`cat $pid`"
 
 $herd stop root
-kill -0 $shepherd_pid && false
+if kill -0 $shepherd_pid
+then
+    sleep 3
+    kill -0 $shepherd_pid && false
+fi
 
-rm -rf $confdir
-rm -rf $datadir
+rm -rf "$confdir" "$datadir"
diff --git a/tests/starting-status.sh b/tests/starting-status.sh
index 81e371c..386491b 100644
--- a/tests/starting-status.sh
+++ b/tests/starting-status.sh
@@ -135,7 +135,6 @@ $herd status test | grep stopped
 
 
 $herd stop root
-kill -0 $shepherd_pid && false
 
 rm -rf "$confdir"
 rm -rf "$datadir"
diff --git a/tests/status-sexp.sh b/tests/status-sexp.sh
index 0d1270a..dc6717f 100644
--- a/tests/status-sexp.sh
+++ b/tests/status-sexp.sh
@@ -160,6 +160,5 @@ $define_reset_timestamps
             (error #f) (messages ()))))"
 
 $herd stop root
-kill -0 $shepherd_pid && false
 
 test -f "$log"
diff --git a/tests/stopping-status.sh b/tests/stopping-status.sh
index 7b2c224..2dc3ceb 100644
--- a/tests/stopping-status.sh
+++ b/tests/stopping-status.sh
@@ -147,7 +147,5 @@ $herd status test | grep stopped
 
 
 $herd stop root
-kill -0 $shepherd_pid && false
 
-rm -rf "$confdir"
-rm -rf "$datadir"
+rm -rf "$confdir" "$datadir"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]