diff stream_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 824754da4afc
children 122cd3a82367
line wrap: on
line diff
--- a/stream_proxy.t
+++ b/stream_proxy.t
@@ -24,7 +24,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/stream/)->plan(4)
+my $t = Test::Nginx->new()->has(qw/stream/)->plan(5)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -63,6 +63,13 @@ is(stream_read($s), 'close', 'proxy conn
 stream_write($s, 'test');
 is(stream_read($s), '', 'proxy connection closed');
 
+$s = stream_connect();
+
+sleep 2;
+
+stream_write($s, 'foo');
+is(stream_read($s), 'bar', 'proxy connect timeout');
+
 ###############################################################################
 
 sub stream_connect {