[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 04/05: tests: Poll less aggressively.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 04/05: tests: Poll less aggressively. |
Date: |
Mon, 18 Jan 2016 22:10:58 +0000 |
civodul pushed a commit to branch master
in repository shepherd.
commit e80da2294380cb5026b1538828a733598ae5581f
Author: Ludovic Courtès <address@hidden>
Date: Mon Jan 18 22:13:15 2016 +0100
tests: Poll less aggressively.
Among other things, this makes test logs *much* shorter.
* tests/basic.sh: Use "sleep 0.3" instead of ":" in loops that poll for
"$pid".
* tests/no-home.sh: Likewise.
* tests/status-sexp.sh: Likewise.
---
tests/basic.sh | 4 ++--
tests/no-home.sh | 2 +-
tests/status-sexp.sh | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/basic.sh b/tests/basic.sh
index 3e500df..7e5faa7 100644
--- a/tests/basic.sh
+++ b/tests/basic.sh
@@ -61,7 +61,7 @@ rm -f "$pid"
shepherd -I -s "$socket" -c "$conf" -l "$log" --pid="$pid" &
# Wait till it's ready.
-while ! test -f "$pid" ; do : ; done
+while ! test -f "$pid" ; do sleep 0.3 ; done
dmd_pid="`cat $pid`"
@@ -112,7 +112,7 @@ rm -f "$pid"
shepherd -I -s "$socket" --pid="$pid" &
# Wait till it's ready.
-while ! test -f "$pid" ; do : ; done
+while ! test -f "$pid" ; do sleep 0.3 ; done
# Launch a service from $confdir/shepherd/init.scm.
$herd start test
diff --git a/tests/no-home.sh b/tests/no-home.sh
index 3cf773a..132753b 100644
--- a/tests/no-home.sh
+++ b/tests/no-home.sh
@@ -40,7 +40,7 @@ shepherd -I -s "$socket" -c /dev/null -l /dev/null
--pid="$pid" &
dmd_pid="$!"
# Wait until it's ready, or until it terminates.
-while ! test -f "$pid" ; do kill -0 "$dmd_pid" ; done
+while ! test -f "$pid" ; do kill -0 "$dmd_pid" ; sleep 0.3 ; done
kill -0 `cat "$pid"`
$herd status dmd
diff --git a/tests/status-sexp.sh b/tests/status-sexp.sh
index c3fcbba..d77007f 100644
--- a/tests/status-sexp.sh
+++ b/tests/status-sexp.sh
@@ -52,7 +52,7 @@ rm -f "$pid"
shepherd -I -s "$socket" -c "$conf" -l "$log" --pid="$pid" &
# Wait till it's ready.
-while ! test -f "$pid" ; do : ; done
+while ! test -f "$pid" ; do sleep 0.3 ; done
dmd_pid="`cat $pid`"