# HG changeset patch # User Sergey Kandaurov # Date 1545650691 -10800 # Node ID 4e48bf51714f28215128b2d0c4a825bfe10c8607 # Parent ea593a9bab098a6db7a5296b4105034f0ecedb14 Tests: aligned various generic read timeouts to http_end(). It was observed that previous timeout values could not be enough when making mass-building, in particular, when running with modsecurity. diff --git a/h2_fastcgi_request_buffering.t b/h2_fastcgi_request_buffering.t --- a/h2_fastcgi_request_buffering.t +++ b/h2_fastcgi_request_buffering.t @@ -265,7 +265,7 @@ sub backend_read { my ($s, $timo) = @_; my $buf = ''; - if (IO::Select->new($s)->can_read($timo || 5)) { + if (IO::Select->new($s)->can_read($timo || 8)) { $s->sysread($buf, 16384) or return; log2i($buf); } diff --git a/h2_proxy_request_buffering.t b/h2_proxy_request_buffering.t --- a/h2_proxy_request_buffering.t +++ b/h2_proxy_request_buffering.t @@ -265,7 +265,7 @@ sub backend_read { my ($s, $timo) = @_; my $buf = ''; - if (IO::Select->new($s)->can_read($timo || 5)) { + if (IO::Select->new($s)->can_read($timo || 8)) { $s->sysread($buf, 16384) or return; log2i($buf); } diff --git a/h2_proxy_request_buffering_ssl.t b/h2_proxy_request_buffering_ssl.t --- a/h2_proxy_request_buffering_ssl.t +++ b/h2_proxy_request_buffering_ssl.t @@ -270,7 +270,7 @@ sub backend_read { my ($s, $timo) = @_; my $buf = ''; - if (IO::Select->new($s)->can_read($timo || 5)) { + if (IO::Select->new($s)->can_read($timo || 8)) { $s->sysread($buf, 16384) or return; log2i($buf); } diff --git a/h2_ssl_verify_client.t b/h2_ssl_verify_client.t --- a/h2_ssl_verify_client.t +++ b/h2_ssl_verify_client.t @@ -114,7 +114,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/lib/Test/Nginx/HTTP2.pm b/lib/Test/Nginx/HTTP2.pm --- a/lib/Test/Nginx/HTTP2.pm +++ b/lib/Test/Nginx/HTTP2.pm @@ -465,7 +465,7 @@ sub unpack_length { sub raw_read { my ($s, $buf, $len, $timo) = @_; - $timo = 5 unless $timo; + $timo = 8 unless $timo; my $got = ''; while (length($buf) < $len && IO::Select->new($s)->can_read($timo)) { @@ -501,7 +501,7 @@ sub new_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::INET->new( Proto => 'tcp', PeerAddr => "127.0.0.1:$port", diff --git a/ssl.t b/ssl.t --- a/ssl.t +++ b/ssl.t @@ -300,7 +300,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/ssl_certificate_chain.t b/ssl_certificate_chain.t --- a/ssl_certificate_chain.t +++ b/ssl_certificate_chain.t @@ -150,7 +150,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/ssl_certificates.t b/ssl_certificates.t --- a/ssl_certificates.t +++ b/ssl_certificates.t @@ -121,7 +121,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::INET->new('127.0.0.1:' . port(8080)); alarm(0); }; diff --git a/ssl_client_escaped_cert.t b/ssl_client_escaped_cert.t --- a/ssl_client_escaped_cert.t +++ b/ssl_client_escaped_cert.t @@ -101,7 +101,7 @@ sub cert { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/ssl_crl.t b/ssl_crl.t --- a/ssl_crl.t +++ b/ssl_crl.t @@ -178,7 +178,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/ssl_password_file.t b/ssl_password_file.t --- a/ssl_password_file.t +++ b/ssl_password_file.t @@ -147,7 +147,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1:' . port(8081), diff --git a/ssl_proxy_protocol.t b/ssl_proxy_protocol.t --- a/ssl_proxy_protocol.t +++ b/ssl_proxy_protocol.t @@ -156,7 +156,7 @@ sub pp_get { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); IO::Socket::SSL->start_SSL($s, SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(), SSL_error_trap => sub { die $_[1] } diff --git a/ssl_sni.t b/ssl_sni.t --- a/ssl_sni.t +++ b/ssl_sni.t @@ -133,7 +133,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1:' . port(8080), diff --git a/ssl_sni_reneg.t b/ssl_sni_reneg.t --- a/ssl_sni_reneg.t +++ b/ssl_sni_reneg.t @@ -171,7 +171,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); socket($s, &AF_INET, &SOCK_STREAM, 0) or die "socket: $!"; connect($s, $dest_serv_params) or die "connect: $!"; alarm(0); diff --git a/ssl_sni_sessions.t b/ssl_sni_sessions.t --- a/ssl_sni_sessions.t +++ b/ssl_sni_sessions.t @@ -177,7 +177,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/ssl_stapling.t b/ssl_stapling.t --- a/ssl_stapling.t +++ b/ssl_stapling.t @@ -294,7 +294,7 @@ sub staple { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::INET->new('127.0.0.1:' . port($port)); alarm(0); }; @@ -335,7 +335,7 @@ sub get_version { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::INET->new('127.0.0.1:' . port(8443)); alarm(0); }; diff --git a/ssl_verify_depth.t b/ssl_verify_depth.t --- a/ssl_verify_depth.t +++ b/ssl_verify_depth.t @@ -142,7 +142,7 @@ sub get_ssl_socket { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); $s = IO::Socket::SSL->new( Proto => 'tcp', PeerAddr => '127.0.0.1', diff --git a/stream_ssl_preread.t b/stream_ssl_preread.t --- a/stream_ssl_preread.t +++ b/stream_ssl_preread.t @@ -223,7 +223,7 @@ sub get_ssl { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); IO::Socket::SSL->start_SSL($s->{_socket}, SSL_hostname => $host, SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(), diff --git a/stream_ssl_preread_alpn.t b/stream_ssl_preread_alpn.t --- a/stream_ssl_preread_alpn.t +++ b/stream_ssl_preread_alpn.t @@ -127,7 +127,7 @@ sub get_ssl { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); IO::Socket::SSL->start_SSL($s->{_socket}, SSL_alpn_protocols => [ @alpn ], SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(), diff --git a/stream_ssl_realip.t b/stream_ssl_realip.t --- a/stream_ssl_realip.t +++ b/stream_ssl_realip.t @@ -134,7 +134,7 @@ sub pp_get { eval { local $SIG{ALRM} = sub { die "timeout\n" }; local $SIG{PIPE} = sub { die "sigpipe\n" }; - alarm(5); + alarm(8); IO::Socket::SSL->start_SSL($s->{_socket}, SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE(), SSL_error_trap => sub { die $_[1] }