# HG changeset patch # User Sergey Kandaurov # Date 1473863458 -10800 # Node ID be45fa007655086cf09f58bce1ff09cf423c2d6a # Parent 094e1247740fbf502ba7d933e638451e7da4e6b9 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. diff --git a/proxy_cache_lock_ssi.t b/proxy_cache_lock_ssi.t --- 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'); ###############################################################################