changeset 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 a79bf84726af
children 6979619de0e3
files stream_status_variable.t
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/stream_status_variable.t
+++ b/stream_status_variable.t
@@ -72,12 +72,10 @@ stream {
         limit_conn  zone 1;
         proxy_pass  127.0.0.1:8086;
         access_log  %%TESTDIR%%/503.log status;
-
-        proxy_download_rate 1;
     }
 
     server {
-        listen      127.0.0.1:8086;
+        listen      127.0.0.1:8086 proxy_protocol;
         return      SEE-THIS;
     }
 }
@@ -94,9 +92,7 @@ stream('127.0.0.1:' . port(8082))->read(
 stream('127.0.0.1:' . port(8084))->read();
 
 my $s = stream('127.0.0.1:' . port(8085));
-$s->write('busy');
 stream('127.0.0.1:' . port(8085))->read();
-$s->read();
 undef $s;
 
 $t->stop();