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 #144pull/147/head
parent
778561eabf
commit
e505eb2a13
|
@ -90,6 +90,11 @@ function nginx_start () {
|
|||
if [[ $# -gt 0 || ! -r ${NGINX_CONF} ]] ; then nginx_conf "$@" ; fi
|
||||
nginx_stop # Ensure that it is not running.
|
||||
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 () {
|
||||
|
|
Loading…
Reference in New Issue