You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2017/06/28 01:26:09 UTC
svn commit: r1800110 - in /httpd/test/framework/trunk: README
t/modules/proxy.t t/modules/proxy_fcgi.t
Author: jim
Date: Wed Jun 28 01:26:09 2017
New Revision: 1800110
URL: http://svn.apache.org/viewvc?rev=1800110&view=rev
Log:
prevent inf loops...
Modified:
httpd/test/framework/trunk/README
httpd/test/framework/trunk/t/modules/proxy.t
httpd/test/framework/trunk/t/modules/proxy_fcgi.t
Modified: httpd/test/framework/trunk/README
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/README?rev=1800110&r1=1800109&r2=1800110&view=diff
==============================================================================
--- httpd/test/framework/trunk/README (original)
+++ httpd/test/framework/trunk/README Wed Jun 28 01:26:09 2017
@@ -31,6 +31,7 @@ CPAN modules will be required. If the te
that you have up to date versions of each of these perl modules:
- HTTP::DAV (DAV tests)
- DateTime (mod_include tests)
+- Time::HiRes
- Protocol::HTTP2::Client and AnyEvent (mod_http2 tests)
- Test
- Test::Harness
Modified: httpd/test/framework/trunk/t/modules/proxy.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/proxy.t?rev=1800110&r1=1800109&r2=1800110&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/proxy.t (original)
+++ httpd/test/framework/trunk/t/modules/proxy.t Wed Jun 28 01:26:09 2017
@@ -6,6 +6,8 @@ use Apache::TestRequest;
use Apache::TestUtil;
use Apache::TestConfig ();
+use Time::HiRes qw(usleep);
+
my $num_tests = 20;
if (have_min_apache_version('2.4.7')) {
$num_tests++;
@@ -138,7 +140,15 @@ if (have_min_apache_version('2.4.7')) {
uds_script($socket_path);
exit;
}
- while (! -e $socket_path) {}
+ my $timer = time() + 2;
+ while (! -e $socket_path) {
+ usleep(100);
+ last if (time() >= $timer);
+ }
+ unless ( -e $socket_path) {
+ ok 0;
+ exit;
+ }
$r = GET("/uds/");
ok t_cmp($r->code, 200, "ProxyPass UDS path");
}
Modified: httpd/test/framework/trunk/t/modules/proxy_fcgi.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/proxy_fcgi.t?rev=1800110&r1=1800109&r2=1800110&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/proxy_fcgi.t (original)
+++ httpd/test/framework/trunk/t/modules/proxy_fcgi.t Wed Jun 28 01:26:09 2017
@@ -5,6 +5,8 @@ use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil;
+use Time::HiRes qw(usleep);
+
my $have_fcgisetenvif = have_min_apache_version('2.4.26');
my $have_fcgibackendtype = have_min_apache_version('2.4.26');
my $have_php_fpm = `php-fpm -v` =~ /fpm-fcgi/;
@@ -243,7 +245,15 @@ if ($have_php_fpm) {
system "php-fpm -g $pid_file -p $servroot/php-fpm";
}
# Wait for php-fpm to start-up
- while (!-e $pid_file) {}
+ my $timer = time() + 2;
+ while (! -e $pid_file) {
+ usleep(100);
+ last if (time() >= $timer);
+ }
+ unless ( -e $pid_file ) {
+ ok 0;
+ exit;
+ }
$envs = run_fcgi_envvar_request(-1, "/fpm/sub1/sub2/test.php?query", "PHP-FPM");
ok t_cmp($envs->{'SCRIPT_NAME'}, '/fpm/sub1/sub2/test.php', "Server sets correct SCRIPT_NAME by default");