guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 02/02: tests: Test more service respawns.


From: Ludovic Courtès
Subject: [shepherd] 02/02: tests: Test more service respawns.
Date: Sat, 27 May 2023 17:25:18 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 93ce9343f22ebf6aef6b87fdeb2b14fa3d52ef43
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat May 27 22:36:01 2023 +0200

    tests: Test more service respawns.
    
    * tests/respawn.sh: Add call to 'default-respawn-limit' in $conf.
    Call 'assert_killed_service_is_respawned' in a loop.
---
 tests/respawn.sh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/respawn.sh b/tests/respawn.sh
index 4a4d339..40f1334 100644
--- a/tests/respawn.sh
+++ b/tests/respawn.sh
@@ -62,6 +62,9 @@ function assert_killed_service_is_respawned
 }
 
 cat > "$conf"<<EOF
+;; Disable respawn throttling.
+(default-respawn-limit '(+inf.0 . 1))
+
 (register-services
  (list
   (service
@@ -113,12 +116,11 @@ kill -0 `cat "$service1_pid"`
 kill -0 `cat "$service2_pid"`
 
 # Now, kill the services, and make sure they both get respawned.
-assert_killed_service_is_respawned "$service1_pid"
-assert_killed_service_is_respawned "$service2_pid"
-assert_killed_service_is_respawned "$service1_pid"
-assert_killed_service_is_respawned "$service2_pid"
-assert_killed_service_is_respawned "$service1_pid"
-assert_killed_service_is_respawned "$service2_pid"
+for i in $(seq 1 10)
+do
+    assert_killed_service_is_respawned "$service1_pid"
+    assert_killed_service_is_respawned "$service2_pid"
+done
 
 # Make sure the respawnable service can be stopped.
 pid="`cat "$service1_pid"`"



reply via email to

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