[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 01/03: tests: Improve synchronization in starting/stopping te
From: |
Ludovic Courtès |
Subject: |
[shepherd] 01/03: tests: Improve synchronization in starting/stopping tests. |
Date: |
Sat, 29 Apr 2023 16:41:16 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit 7addb01ad218c7292fb510e4bc2d94eb6b436c8a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Apr 29 22:13:03 2023 +0200
tests: Improve synchronization in starting/stopping tests.
This is a followup to 347d274e945334cbc0247512da84ccb9efcad0ff and
f418f74a8e5848f5af0f94821c997410755f8579.
* tests/starting-status.sh: Loop until 'herd status test' shows
"starting".
* tests/stopping-status.sh: Loop until 'herd status test' show "being
stopped".
---
tests/starting-status.sh | 2 ++
tests/stopping-status.sh | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/starting-status.sh b/tests/starting-status.sh
index bcd08b2..8e011e9 100644
--- a/tests/starting-status.sh
+++ b/tests/starting-status.sh
@@ -112,6 +112,8 @@ echo "Now trying to stop a service in 'starting' state."
$herd start test &
herd_start_pid=$!
+while ! $herd status test | grep starting; do sleep 0.5; done
+
$herd stop test &
herd_stop_pid1=$!
$herd stop test &
diff --git a/tests/stopping-status.sh b/tests/stopping-status.sh
index 554554d..df2f0a4 100644
--- a/tests/stopping-status.sh
+++ b/tests/stopping-status.sh
@@ -118,7 +118,8 @@ $herd status test | grep running
$herd stop test &
herd_stop_pid=$!
-$herd status test | grep "being stopped"
+while ! $herd status test | grep "being stopped"; do sleep 0.5; done
+
$herd start test &
herd_start_pid1=$!
$herd start test &