Mercurial > hg > nginx-tests
changeset 565:ff49e1c00b35
Tests: in stream tests, try to read all the data where appropriate.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 29 Apr 2015 14:58:27 +0300 |
parents | a1c93746570d |
children | 4296379213c8 |
files | stream_error_log.t stream_proxy_next_upstream.t stream_upstream.t stream_upstream_least_conn.t |
diffstat | 4 files changed, 20 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/stream_error_log.t Mon Apr 27 17:18:10 2015 +0300 +++ b/stream_error_log.t Wed Apr 29 14:58:27 2015 +0300 @@ -170,10 +170,12 @@ $peer = '127.0.0.1:8080' unless defined $peer; my $s = stream_connect($peer); stream_write($s, $data); - my $r = stream_read($s); - $s->close; - return $r; + $data = ''; + while (my $buf = stream_read($s)) { + $data .= $buf; + } + return $data; } sub stream_connect {
--- a/stream_proxy_next_upstream.t Mon Apr 27 17:18:10 2015 +0300 +++ b/stream_proxy_next_upstream.t Wed Apr 29 14:58:27 2015 +0300 @@ -85,10 +85,12 @@ my $s = stream_connect($peer); stream_write($s, $data); - my $r = stream_read($s); - $s->close; - return $r; + $data = ''; + while (my $buf = stream_read($s)) { + $data .= $buf; + } + return $data; } sub stream_connect {
--- a/stream_upstream.t Mon Apr 27 17:18:10 2015 +0300 +++ b/stream_upstream.t Wed Apr 29 14:58:27 2015 +0300 @@ -119,10 +119,12 @@ my $s = stream_connect($peer); stream_write($s, $data); - my $r = stream_read($s); - $s->close; - return $r; + $data = ''; + while (my $buf = stream_read($s)) { + $data .= $buf; + } + return $data; } sub stream_connect {
--- a/stream_upstream_least_conn.t Mon Apr 27 17:18:10 2015 +0300 +++ b/stream_upstream_least_conn.t Wed Apr 29 14:58:27 2015 +0300 @@ -109,10 +109,12 @@ my $s = stream_connect($peer); stream_write($s, $data); - my $r = stream_read($s); - $s->close; - return $r; + $data = ''; + while (my $buf = stream_read($s)) { + $data .= $buf; + } + return $data; } sub stream_connect {