changeset 1138:d6acd17ca4e3

Tests: added proxy_cache_background_update + if test.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 27 Feb 2017 17:15:24 +0300
parents 129b9e4ca3b3
children e7e968e3eb74
files proxy_cache_use_stale.t
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 {