mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 20:46:01 +01:00
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)
(cherry picked from commit 9c470cb969)
This commit is contained in:
parent
196670af76
commit
ddbb122df1
1 changed files with 4 additions and 4 deletions
|
|
@ -92,9 +92,9 @@ startDaemon() {
|
|||
rm -f $NIX_DAEMON_SOCKET_PATH
|
||||
PATH=$DAEMON_PATH nix-daemon &
|
||||
pidDaemon=$!
|
||||
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
|
||||
trap "killDaemon" EXIT
|
||||
# Save for if daemon is killed
|
||||
|
|
@ -104,9 +104,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue