# HG changeset patch # User Sergey Kandaurov # Date 1488204924 -10800 # Node ID d6acd17ca4e3b24407f54dac110e57845be8e307 # Parent 129b9e4ca3b364087b03fc7fd709f28f9ae1031f Tests: added proxy_cache_background_update + if test. diff --git a/proxy_cache_use_stale.t b/proxy_cache_use_stale.t --- a/proxy_cache_use_stale.t +++ b/proxy_cache_use_stale.t @@ -79,6 +79,10 @@ http { proxy_cache_valid 1s; } + + if ($arg_if) { + # nothing + } } } server { @@ -107,7 +111,7 @@ EOF $t->write_file('t3.html', 'SEE-THIS'); $t->write_file('t6.html', 'SEE-THIS'); -$t->try_run('no proxy_cache_background_update')->plan(25); +$t->try_run('no proxy_cache_background_update')->plan(27); ############################################################################### @@ -175,6 +179,18 @@ like(http_get('/tt.html?e=1'), qr/ 500 / like(http_get('/updating/t2.html'), qr/STALE/, 's-w-r - overriden with use_stale updating'); +# due to the missing content_handler inheritance in a cloned subrequest, +# this used to access a static file in the update request + +like(http_get('/t2.html?if=1'), qr/STALE/, 'background update in if'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.11.11'); + +like(http_get('/t2.html?if=1'), qr/HIT/, 'background update in if - updated'); + +} + ############################################################################### sub get {