Mercurial > hg > nginx-tests
diff proxy_limit_rate.t @ 628:0940773278c7
Tests: backed out previous change, adjusted general timeouts.
The previous timeout values are commonly not enough when making mass-building.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 09 Jul 2015 14:09:27 +0300 |
parents | cb35a9ec4428 |
children | a53c310c695d |
line wrap: on
line diff
--- a/proxy_limit_rate.t +++ b/proxy_limit_rate.t @@ -58,8 +58,7 @@ EOF ############################################################################### -my $s = http_get('/', start => 1); -my $r = http_end_gentle($s); +my $r = http_get('/'); my ($t1) = $r =~ /X-Msec: (\d+)/; my $diff = time() - $t1; @@ -70,29 +69,3 @@ cmp_ok(abs($diff - 3), '<=', 1, 'proxy_l like($r, qr/^(XXXXXXXXXX){4000}\x0d?\x0a?$/m, 'response body'); ############################################################################### - -sub http_end_gentle { - my ($s) = @_; - my $reply; - - eval { - local $SIG{ALRM} = sub { die "timeout\n" }; - local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(8); - - local $/; - $reply = $s->getline(); - - alarm(0); - }; - alarm(0); - if ($@) { - log_in("died: $@"); - return undef; - } - - log_in($reply); - return $reply; -} - -###############################################################################