Mercurial > hg > nginx-tests
diff proxy_cache_lock_ssi.t @ 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 | 196d33c2bb45 |
children |
line wrap: on
line diff
--- a/proxy_cache_lock_ssi.t Thu Sep 08 16:29:03 2016 +0300 +++ b/proxy_cache_lock_ssi.t Wed Sep 14 17:30:58 2016 +0300 @@ -51,8 +51,6 @@ proxy_cache_lock_timeout 100ms; proxy_read_timeout 3s; - - add_header X-Msec $msec; } location = /ssi.html { @@ -83,7 +81,7 @@ ############################################################################### -# 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 @@ # 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'); ###############################################################################