changeset 547:714668aea2b0

Tests: adjusted proxy_cache_lock tests with subrequests. Start time is now taken from nginx for greater accuracy.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 17 Apr 2015 15:12:07 +0300
parents fa48f8a195a3
children 56c3a8310076
files proxy_cache_lock_ssi.t
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_cache_lock_ssi.t
+++ b/proxy_cache_lock_ssi.t
@@ -53,6 +53,8 @@ http {
             proxy_cache_lock_timeout 100ms;
 
             proxy_read_timeout 2s;
+
+            add_header X-Msec $msec;
         }
 
         location = /ssi.html {
@@ -94,11 +96,9 @@ EOF
 # is woken up by the postpone filter once first subrequest completes,
 # but this is suboptimal behaviour
 
-my $start = time();
-
 my $s = http_get('/locked', start => 1);
 like(http_get('/ssi.html'), qr/end/, 'cache lock ssi');
-http_end($s);
+my ($start) = http_end($s) =~ /X-Msec: (\d+)/;
 
 TODO: {
 local $TODO = 'not yet' unless $t->has_version('1.7.8');