From 62c8947b2d5c68cd10fac2c27c0d5c1962ffbf42 Mon Sep 17 00:00:00 2001 From: Otto van der Schaaf Date: Thu, 12 Feb 2015 17:47:15 +0100 Subject: [PATCH] configuration-reload-test: wait for the new worker to get ready After sending a SIGHUP, wait for the new worker process with the new configuration to handle further requests, or else the tests running after that might get confused when the new worker becomes active with fresh shared mem statistics and shared mem cache. --- test/nginx_system_test.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/nginx_system_test.sh b/test/nginx_system_test.sh index c23ccf960..1362dcf2d 100644 --- a/test/nginx_system_test.sh +++ b/test/nginx_system_test.sh @@ -302,6 +302,9 @@ fi # # TODO(sligicki): When the prioritize critical css race condition is fixed, the # two prioritize_critical_css tests no longer need to be listed here. +# TODO(oschaaf): Now that we wait after we send a SIGHUP for the new worker +# process to handle requests, check if we can remove more from the expected +# failures here under valgrind. if $USE_VALGRIND; then PAGESPEED_EXPECTED_FAILURES+=" ~combine_css Maximum size of combined CSS.~ @@ -310,7 +313,6 @@ if $USE_VALGRIND; then ~IPRO flow uses cache as expected.~ ~IPRO flow doesn't copy uncacheable resources multiple times.~ ~inline_unauthorized_resources allows unauthorized css selectors~ -~Blocking rewrite enabled.~ " fi @@ -551,6 +553,14 @@ fire_ab_load check wget $EXAMPLE_ROOT/styles/W.rewrite_css_images.css.pagespeed.cf.Hash.css \ -O /dev/null check_simple "$NGINX_EXECUTABLE" -s reload -c "$PAGESPEED_CONF" +# Wait for the new worker process with the new configuration to get ready, or +# else the sudden reset of the shared mem statistics/cache might catch upcoming +# tests unaware. +while [ $(scrape_stat image_rewrite_total_original_bytes) -gt 0 ] +do + echo "Waiting for new worker to get ready..." + sleep .1 +done check wget $EXAMPLE_ROOT/styles/W.rewrite_css_images.css.pagespeed.cf.Hash.css \ -O /dev/null