comparison stream_status_variable.t @ 1228:31045e639732

Tests: fixed stream_status_variable.t transient failure on win32. Use "listen .. proxy_protocol" to hold connections on stream backend and trigger stream status 503 by limiting access by the number of connections. The previous approach using proxy_download_rate doesn't work well on win32, since WSARecv() fails on pending data after backend closed the connection.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 13 Oct 2017 17:42:10 +0300
parents 75a83f36cff0
children 6979619de0e3
comparison
equal deleted inserted replaced
1227:a79bf84726af 1228:31045e639732
70 server { 70 server {
71 listen 127.0.0.1:8085; 71 listen 127.0.0.1:8085;
72 limit_conn zone 1; 72 limit_conn zone 1;
73 proxy_pass 127.0.0.1:8086; 73 proxy_pass 127.0.0.1:8086;
74 access_log %%TESTDIR%%/503.log status; 74 access_log %%TESTDIR%%/503.log status;
75
76 proxy_download_rate 1;
77 } 75 }
78 76
79 server { 77 server {
80 listen 127.0.0.1:8086; 78 listen 127.0.0.1:8086 proxy_protocol;
81 return SEE-THIS; 79 return SEE-THIS;
82 } 80 }
83 } 81 }
84 82
85 EOF 83 EOF
92 stream('127.0.0.1:' . port(8081))->read(); 90 stream('127.0.0.1:' . port(8081))->read();
93 stream('127.0.0.1:' . port(8082))->read(); 91 stream('127.0.0.1:' . port(8082))->read();
94 stream('127.0.0.1:' . port(8084))->read(); 92 stream('127.0.0.1:' . port(8084))->read();
95 93
96 my $s = stream('127.0.0.1:' . port(8085)); 94 my $s = stream('127.0.0.1:' . port(8085));
97 $s->write('busy');
98 stream('127.0.0.1:' . port(8085))->read(); 95 stream('127.0.0.1:' . port(8085))->read();
99 $s->read();
100 undef $s; 96 undef $s;
101 97
102 $t->stop(); 98 $t->stop();
103 99
104 is($t->read_file('200.log'), "200\n", 'stream status 200'); 100 is($t->read_file('200.log'), "200\n", 'stream status 200');