guix-commits
[Top][All Lists]
Advanced

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

[shepherd] branch master updated: tests: Avoid possible race condition i


From: Ludovic Courtès
Subject: [shepherd] branch master updated: tests: Avoid possible race condition in 'tests/no-home.sh'.
Date: Mon, 17 Jan 2022 08:43:29 -0500

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 e025f83  tests: Avoid possible race condition in 'tests/no-home.sh'.
e025f83 is described below

commit e025f83c2072e4a6533a5747682810a885e20b2e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jan 17 14:27:37 2022 +0100

    tests: Avoid possible race condition in 'tests/no-home.sh'.
    
    Fixes <https://issues.guix.gnu.org/52779>.
    Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.
    
    It would seem there's a race condition, whereby the shell running
    'no-home.sh' may or may not have called waitpid(2) for the child
    'shepherd' process by the time 'kill' was invoked.
    
    * tests/no-home.sh: Terminate with 'wait' rather than 'kill'.
---
 tests/no-home.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tests/no-home.sh b/tests/no-home.sh
index 85b6116..5a8c278 100644
--- a/tests/no-home.sh
+++ b/tests/no-home.sh
@@ -1,5 +1,5 @@
 # GNU Shepherd --- Make sure shepherd doesn't fail when $HOME is not writable.
-# Copyright © 2014, 2016 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2014, 2016, 2022 Ludovic Courtès <ludo@gnu.org>
 #
 # This file is part of the GNU Shepherd.
 #
@@ -46,7 +46,4 @@ kill -0 `cat "$pid"`
 $herd status root
 $herd stop root
 
-if kill `cat "$pid"`
-then
-    exit 1
-fi
+wait `cat "$pid"`



reply via email to

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