comparison proxy_cache_use_stale.t @ 1693:5ac6efbe5552

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 01 Jun 2021 16:40:18 +0300
parents 17b227c271a2
children 4b808861a318
comparison
equal deleted inserted replaced
1692:f6795e2e6a4b 1693:5ac6efbe5552
177 get('/escape html', 'max-age=1, stale-while-revalidate=10'); 177 get('/escape html', 'max-age=1, stale-while-revalidate=10');
178 get('/regexp.html', 'max-age=1, stale-while-revalidate=10'); 178 get('/regexp.html', 'max-age=1, stale-while-revalidate=10');
179 179
180 sleep 2; 180 sleep 2;
181 181
182 TODO: {
183 local $TODO = 'not yet' unless $t->has_version('1.19.3');
184
185 # stale 5xx response is ignored since 1.19.3, 182 # stale 5xx response is ignored since 1.19.3,
186 # "proxy_cache_use_stale updating;" allows to get it still 183 # "proxy_cache_use_stale updating;" allows to get it still
187 184
188 like(http_get('/t.html?e=1'), qr/ 500 /, 's-i-e - stale 5xx ignore'); 185 like(http_get('/t.html?e=1'), qr/ 500 /, 's-i-e - stale 5xx ignore');
189 like(http_get('/tt.html?e=1'), qr/ 500 /, 's-i-e - stale 5xx ignore 2'); 186 like(http_get('/tt.html?e=1'), qr/ 500 /, 's-i-e - stale 5xx ignore 2');
190
191 }
192
193 like(http_get('/updating/tt.html'), qr/STALE/, 's-i-e - stale 5xx updating'); 187 like(http_get('/updating/tt.html'), qr/STALE/, 's-i-e - stale 5xx updating');
194 like(http_get('/t.html'), qr/REVALIDATED/, 's-i-e - revalidated'); 188 like(http_get('/t.html'), qr/REVALIDATED/, 's-i-e - revalidated');
195 189
196 like(http_get('/t2.html?e=1'), qr/STALE/, 's-w-r - revalidate error'); 190 like(http_get('/t2.html?e=1'), qr/STALE/, 's-w-r - revalidate error');
197 like(http_get('/t2.html'), qr/STALE/, 's-w-r - stale while revalidate'); 191 like(http_get('/t2.html'), qr/STALE/, 's-w-r - stale while revalidate');
199 193
200 like(get('/t4.html', 'max-age=1, stale-while-revalidate=2'), qr/STALE/, 194 like(get('/t4.html', 'max-age=1, stale-while-revalidate=2'), qr/STALE/,
201 's-w-r - unconditional revalidate'); 195 's-w-r - unconditional revalidate');
202 like(http_get('/t4.html'), qr/HIT/, 's-w-r - unconditional revalidated'); 196 like(http_get('/t4.html'), qr/HIT/, 's-w-r - unconditional revalidated');
203 197
204 TODO: {
205 local $TODO = 'not yet' unless $t->has_version('1.19.3');
206
207 like(http_get('/t5.html?e=1'), qr/ 500 /, 198 like(http_get('/t5.html?e=1'), qr/ 500 /,
208 's-w-r - foreground revalidate error'); 199 's-w-r - foreground revalidate error');
209
210 }
211
212 like(http_get('/t5.html'), qr/REVALIDATED/, 's-w-r - foreground revalidated'); 200 like(http_get('/t5.html'), qr/REVALIDATED/, 's-w-r - foreground revalidated');
213 201
214 # proxy_pass to regular expression with named and positional captures 202 # proxy_pass to regular expression with named and positional captures
215 203
216 like(http_get('/regexp.html'), qr/STALE/, 's-w-r - regexp background update'); 204 like(http_get('/regexp.html'), qr/STALE/, 's-w-r - regexp background update');