aboutsummaryrefslogtreecommitdiff
path: root/tests/common.sh.in
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2022-02-24 14:57:27 +0100
committerregnat <rg@regnat.ovh>2022-02-24 15:00:23 +0100
commit9c470cb9694408078fa2c289b9b776820e611923 (patch)
treed79c0f9ff48f41e5aa2b3f390c6a0a2ccf48adfd /tests/common.sh.in
parent6524eb4b770380b5a2f17e87a7d1b99a47dbb8f8 (diff)
testS: poll more eagerly for the daemon start/stop
Polling every 1 second means that even the simplest test takes at least 2 seconds. We can reasonably poll 1/10 of that to make things much quicker (esp. given that most of the time 0.1s is enough for the daemon to be started or stopped)
Diffstat (limited to 'tests/common.sh.in')
-rw-r--r--tests/common.sh.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/common.sh.in b/tests/common.sh.in
index 61abab1d7..49068f1c3 100644
--- a/tests/common.sh.in
+++ b/tests/common.sh.in
@@ -91,9 +91,9 @@ startDaemon() {
# ‘nix-daemon’ should have an option to fork into the background.
rm -f $NIX_DAEMON_SOCKET_PATH
PATH=$DAEMON_PATH nix daemon &
- for ((i = 0; i < 30; i++)); do
+ for ((i = 0; i < 300; i++)); do
if [[ -S $NIX_DAEMON_SOCKET_PATH ]]; then break; fi
- sleep 1
+ sleep 0.1
done
pidDaemon=$!
trap "killDaemon" EXIT
@@ -102,9 +102,9 @@ startDaemon() {
killDaemon() {
kill $pidDaemon
- for i in {0.10}; do
+ for i in {0..100}; do
kill -0 $pidDaemon || break
- sleep 1
+ sleep 0.1
done
kill -9 $pidDaemon || true
wait $pidDaemon || true