From d6c395151fa8d9dc42b45d0bcdc3155c0ba5c69e Mon Sep 17 00:00:00 2001 From: hillsp Date: Fri, 13 May 2016 16:06:38 -0400 Subject: [PATCH] Fix nginx_system_test so that it doesn't wait for verify_nginx_release.sh (#1199) or wait indefinitely if it can't kill nginx. --- test/nginx_system_test.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/nginx_system_test.sh b/test/nginx_system_test.sh index 7fafac5fc..c1375ce37 100644 --- a/test/nginx_system_test.sh +++ b/test/nginx_system_test.sh @@ -156,8 +156,14 @@ function fire_ab_load() { killall -s KILL nginx # TODO(oschaaf): Fix waiting for valgrind on 32 bits systems. killall -s KILL memcheck-amd64- -while pgrep nginx > /dev/null; do sleep 1; done -while pgrep memcheck > /dev/null; do sleep 1; done +SECONDS=0 +while pgrep -x nginx >/dev/null || pgrep -q memcheck >/dev/null;do + if [ $SECONDS -gt 20 ]; then + echo "Old processes won't die" >&2 + exit 1 + fi + sleep 1 +done check_simple mkdir -p "$TEST_TMP" PROXY_CACHE="$TEST_TMP/proxycache" @@ -1317,7 +1323,7 @@ if $USE_VALGRIND; then check_not [ -s "$TEST_TMP/valgrind.log" ] else check_simple "$NGINX_EXECUTABLE" -s quit -c "$PAGESPEED_CONF" - while pgrep nginx > /dev/null; do sleep 1; done + while pgrep -x nginx > /dev/null; do sleep 1; done fi if [ "$AB_PID" != "0" ]; then