Mercurial > hg > nginx-tests
diff proxy.t @ 732:984bfe661cce
Tests: stream and http proxy_connect_timeout tests.
The proxy_connect_timeout timer should be disabled after socket was connected.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 05 Oct 2015 13:19:45 +0300 |
parents | cf9183219c59 |
children | 122cd3a82367 |
line wrap: on
line diff
--- a/proxy.t +++ b/proxy.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(4); +my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(5); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -42,6 +42,7 @@ http { location / { proxy_pass http://127.0.0.1:8081; proxy_read_timeout 1s; + proxy_connect_timeout 1s; } location /var { @@ -65,6 +66,12 @@ unlike(http_head('/'), qr/SEE-THIS/, 'pr like(http_get('/var?b=127.0.0.1:8081/'), qr/SEE-THIS/, 'proxy with variables'); +my $s = http('', start => 1); + +sleep 2; + +like(http_get('/', socket => $s), qr/200 OK/, 'proxy connect timeout'); + ############################################################################### sub http_daemon {