Mercurial > hg > nginx-tests
comparison proxy_unfinished.t @ 391:915ef26ac6eb
Tests: fix proxy_unfinished.t failures with big buffers.
With newer systems it becomes common to use huge socket buffers, and
the "no proxy temp" test may unexpectedly fail because disk buffering will
not be used. To reduce this possibility, the "listen ... sndbuf=32k" was
added.
Additionally, regular expression was changed to silently allow full
responses.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 15 Apr 2014 22:04:08 +0400 |
parents | e7dc8f4d0a4b |
children | 847ea345becb |
comparison
equal
deleted
inserted
replaced
390:7a65ebfdb02e | 391:915ef26ac6eb |
---|---|
48 | 48 |
49 proxy_cache_path %%TESTDIR%%/cache levels=1:2 | 49 proxy_cache_path %%TESTDIR%%/cache levels=1:2 |
50 keys_zone=one:1m; | 50 keys_zone=one:1m; |
51 | 51 |
52 server { | 52 server { |
53 listen 127.0.0.1:8080; | 53 listen 127.0.0.1:8080 sndbuf=32k; |
54 server_name localhost; | 54 server_name localhost; |
55 | 55 |
56 location / { | 56 location / { |
57 sub_filter foo bar; | 57 sub_filter foo bar; |
58 sub_filter_types *; | 58 sub_filter_types *; |
158 # if disk buffering fails for some reason, there should be | 158 # if disk buffering fails for some reason, there should be |
159 # no final chunk | 159 # no final chunk |
160 | 160 |
161 chmod(0000, $t->testdir() . '/proxy_temp'); | 161 chmod(0000, $t->testdir() . '/proxy_temp'); |
162 like(http_get_11('/proxy/big.html', sleep => 0.5), | 162 like(http_get_11('/proxy/big.html', sleep => 0.5), |
163 qr/X(?!.*\x0d\x0a?0\x0d\x0a?)/s, 'no proxy temp'); | 163 qr/X(?!.*\x0d\x0a?0\x0d\x0a?)|finished/s, 'no proxy temp'); |
164 | 164 |
165 } | 165 } |
166 | 166 |
167 ############################################################################### | 167 ############################################################################### |
168 | 168 |