Browse Source

Tests: Wait for nginx to create pid file

When nginx is started, it returns control before it has created its pid
file. Since this test suite relies on the existence of the pid file,
wait until the pid file exists before returning from nginx_start. Time
out after 2 seconds so that if there is a real problem starting nginx
we don't wait forever.

Fixes #144
pull/147/head
Ryan Schmidt 3 years ago committed by Adrian Perez
parent
commit
e505eb2a13
  1. 5
      t/preamble

5
t/preamble

@ -90,6 +90,11 @@ function nginx_start () {
if [[ $# -gt 0 || ! -r ${NGINX_CONF} ]] ; then nginx_conf "$@" ; fi if [[ $# -gt 0 || ! -r ${NGINX_CONF} ]] ; then nginx_conf "$@" ; fi
nginx_stop # Ensure that it is not running. nginx_stop # Ensure that it is not running.
nginx nginx
local n=0
while [[ ! -r ${NGINX_PID} && n -lt 20 ]] ; do
sleep 0.1 # Wait until pid exists.
n=$((n+1))
done
} }
function fetch () { function fetch () {

Loading…
Cancel
Save