# HG changeset patch # User Sergey Kandaurov # Date 1609262478 -10800 # Node ID da52525f49d109a7a3857b0986bd81509a3d6043 # Parent 2d371452658cb7754a0c0ec9ecf55bc0ec348fb3 Tests: avoid ssl_certificate.t hang on SIGPIPE. It could stuck in SSL shutdown after abrupt connection termination by nginx. A similar change is applied to stream_ssl_certificate.t for consistency. diff --git a/ssl_certificate.t b/ssl_certificate.t --- a/ssl_certificate.t +++ b/ssl_certificate.t @@ -198,6 +198,9 @@ ok(Net::SSLeay::ERR_peek_error(), 'no ce sub get { my ($host, $port, $ctx) = @_; my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; + + local $SIG{PIPE} = 'IGNORE'; + Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF); my $r = Net::SSLeay::read($ssl); Net::SSLeay::shutdown($ssl); diff --git a/stream_ssl_certificate.t b/stream_ssl_certificate.t --- a/stream_ssl_certificate.t +++ b/stream_ssl_certificate.t @@ -175,6 +175,9 @@ ok(Net::SSLeay::ERR_peek_error(), 'no ce sub get { my ($host, $port, $ctx) = @_; my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; + + local $SIG{PIPE} = 'IGNORE'; + my $r = Net::SSLeay::read($ssl); Net::SSLeay::shutdown($ssl); $s->close();