changeset 1031:be45fa007655

Tests: fixed test preconditions in proxy_cache_lock_ssi.t. Made sure that a proper request order exists between /locked and /ssi. Previously, request /locked could be proxied after subrequest /active, losing in the limit_req race. Also, request /locked was not properly delayed, thus proxy cache lock could not happen later in a subrequest. This somewhat reverts 714668aea2b0 as now inapplicable. While there, fixed a typo.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 14 Sep 2016 17:30:58 +0300
parents 094e1247740f
children 43eedbfea090
files proxy_cache_lock_ssi.t
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_cache_lock_ssi.t
+++ b/proxy_cache_lock_ssi.t
@@ -51,8 +51,6 @@ http {
             proxy_cache_lock_timeout 100ms;
 
             proxy_read_timeout 3s;
-
-            add_header X-Msec $msec;
         }
 
         location = /ssi.html {
@@ -83,7 +81,7 @@ EOF
 
 ###############################################################################
 
-# problem: if proxy cache lock wakeup happens in a an inactive
+# problem: if proxy cache lock wakeup happens in an inactive
 # subrequest, just a connection write event may not trigger any
 # further work
 
@@ -94,9 +92,14 @@ EOF
 # is woken up by the postpone filter once first subrequest completes,
 # but this is suboptimal behaviour
 
+http_get('/charge');
+my $start = time();
+
 my $s = http_get('/locked', start => 1);
+select undef, undef, undef, 0.2;
+
 like(http_get('/ssi.html'), qr/end/, 'cache lock ssi');
-my ($start) = http_end($s) =~ /X-Msec: (\d+)/;
+http_end($s);
 cmp_ok(time() - $start, '<=', 5, 'parallel execution after lock timeout');
 
 ###############################################################################