diff --git a/tests/p_mod_wsgi/mod_wsgi_test.sh b/tests/p_mod_wsgi/mod_wsgi_test.sh
index 3e70c6c..adb64bc 100755
--- a/tests/p_mod_wsgi/mod_wsgi_test.sh
+++ b/tests/p_mod_wsgi/mod_wsgi_test.sh
@@ -23,8 +23,8 @@ def application(environ, start_response):
     return [output]
 EOF
 
-t_ServiceControl httpd stop
 while [ `ps fax | grep 'sbin/httpd' | grep -v grep  | wc -l` -gt 0 ]; do
+  t_ServiceControl httpd stop
   sleep 1
 done
 t_ServiceControl httpd start