@@ -67,7 +67,7 @@ startDaemon() {
6767 die " startDaemon: not supported when testing on NixOS. Is it really needed? If so add conditionals; e.g. if ! isTestOnNixOS; then ..."
6868 fi
6969
70- # Don’ t start the daemon twice, as this would just make it loop indefinitely
70+ # Don' t start the daemon twice, as this would just make it loop indefinitely.
7171 if [[ " ${_NIX_TEST_DAEMON_PID-} " != ' ' ]]; then
7272 return
7373 fi
@@ -76,15 +76,19 @@ startDaemon() {
7676 PATH=$DAEMON_PATH nix --extra-experimental-features ' nix-command' daemon &
7777 _NIX_TEST_DAEMON_PID=$!
7878 export _NIX_TEST_DAEMON_PID
79- for (( i = 0 ; i < 300 ; i++ )) ; do
79+ for (( i = 0 ; i < 60 ; i++ )) ; do
8080 if [[ -S $NIX_DAEMON_SOCKET_PATH ]]; then
8181 DAEMON_STARTED=1
8282 break ;
8383 fi
84+ if ! kill -0 " $_NIX_TEST_DAEMON_PID " ; then
85+ echo " daemon died unexpectedly" >&2
86+ exit 1
87+ fi
8488 sleep 0.1
8589 done
8690 if [[ -z ${DAEMON_STARTED+x} ]]; then
87- fail " Didn’ t manage to start the daemon"
91+ fail " Didn' t manage to start the daemon"
8892 fi
8993 trap " killDaemon" EXIT
9094 # Save for if daemon is killed
@@ -97,7 +101,7 @@ killDaemon() {
97101 die " killDaemon: not supported when testing on NixOS. Is it really needed? If so add conditionals; e.g. if ! isTestOnNixOS; then ..."
98102 fi
99103
100- # Don’ t fail trying to stop a non-existant daemon twice
104+ # Don' t fail trying to stop a non-existant daemon twice.
101105 if [[ " ${_NIX_TEST_DAEMON_PID-} " == ' ' ]]; then
102106 return
103107 fi
@@ -219,7 +223,7 @@ assertStderr() {
219223
220224needLocalStore () {
221225 if [[ " $NIX_REMOTE " == " daemon" ]]; then
222- skipTest " Can’ t run through the daemon ($1 )"
226+ skipTest " Can' t run through the daemon ($1 )"
223227 fi
224228}
225229
0 commit comments