# HG changeset patch # User Sergey Kandaurov # Date 1481022404 -10800 # Node ID 534d209f6ae45315dafef5f71b1e482de3b7749f # Parent b3b1403641d37ffaf1bc784822b1337099c8d303 Tests: fixed ssl_password_file test hang with missing FIFO reader. diff --git a/ssl_password_file.t b/ssl_password_file.t --- a/ssl_password_file.t +++ b/ssl_password_file.t @@ -117,7 +117,8 @@ foreach my $name ('localhost', 'inherits $t->write_file('password_many', "wrong$CRLF" . "localhost$CRLF"); $t->write_file('password_http', 'inherits'); -fork() || exec("echo localhost > $d/password_fifo"); +my $p = fork(); +exec("echo localhost > $d/password_fifo") if $p == 0; # do not mangle with try_run() # we need to distinguish ssl_password_file support vs its brokenness @@ -127,6 +128,7 @@ eval { $t->run(); open STDERR, ">&", \*OLDERR; }; +kill 'INT', $p if $@; ############################################################################### diff --git a/stream_ssl.t b/stream_ssl.t --- a/stream_ssl.t +++ b/stream_ssl.t @@ -118,10 +118,17 @@ my $ctx = Net::SSLeay::CTX_new() or die( $t->write_file('password_many', "wrong$CRLF" . "localhost$CRLF"); $t->write_file('password_http', 'inherits'); -fork() || exec("echo localhost > $d/password_fifo"); +my $p = fork(); +exec("echo localhost > $d/password_fifo") if $p == 0; $t->run_daemon(\&http_daemon); -$t->run(); + +eval { + open OLDERR, ">&", \*STDERR; close STDERR; + $t->run(); + open STDERR, ">&", \*OLDERR; +}; +kill 'INT', $p if $@; $t->waitforsocket('127.0.0.1:' . port(8081));